pixelead0 / tmdb_v3-PHP-API-

Wrapper in PHP for The Movie Data Base version 3
119 stars 81 forks source link

Error when running the example code #29

Closed wuhaa11 closed 9 years ago

wuhaa11 commented 9 years ago

Hi,

First off thanks for this wonderful script. I'm getting this issue when testing the examples/moviesExample.php.

Parse error: syntax error, unexpected '[' in /home/main/www/bot/php/tmdb/tmdb/data/Movie.php on line 108

The code for this error is:

107 public function getTrailer() { 108 return $this->getTrailers() ['youtube'][0]['source']; 109 }

I think this might be a php version issue. Any way I could make this complaint with php5.3?

Thank you,

pixelead0 commented 9 years ago

Try with:

    public function getTrailer() {
        $getTrailers= $this->getTrailers();

        return $getTrailers['youtube'][0]['source'];
    }