pixelead0 / tmdb_v3-PHP-API-

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

How do I get the [character] each actor played in the movie?? #78

Open mpol12 opened 3 years ago

mpol12 commented 3 years ago

Hi, I successfully got all movie details along with the getCast() array which includes all movie actors along with their information. Among this information is the Character the actor plays in the movie. How do I get this information??

For example for movie "The Suicide Squad (2021)" with tmdb_id 436969.. This is the info I get for the first actor Array ( [0] => Person Object ( [_data:Person:private] => Array ( [adult] => [gender] => 1 [id] => 234352 [known_for_department] => Acting [name] => Margot Robbie [original_name] => Margot Robbie [popularity] => 84.384 [profile_path] => /euDPyqLnuwaWMHajcU3oZ9uZezR.jpg [cast_id] => 33 [character] => Harleen Quinzel / Harley Quinn [credit_id] => 5ca268419251411a16098d23 [order] => 0 )

    )

...and the array continues..

I can get almost all data via the defined functions, for example I get the name of the actor with person->getName().. How do I get the "character"??