我确信这非常简单,但我是数组新手,我正在使用 TMDB API 和 PHP。我想知道导演的名字。这是数组的简化版本:
Array
(
[credits] => Array
(
[crew] => Array
(
[0] => Array
(
[id] => 40243
[name] => Gil Junger
[department] => Directing
[job] => Director
[profile_path] =>
)
)
)
)
我已经做到了这一点:
$film_query = file_get_contents("http://api.themoviedb.org/3/movie/".$film_id."?api_key=".$key."&append_to_response=credits,images&json_callback=?");
$film_json = json_decode($film_query, true);
$director = $film_json['credits']['crew']['job'];
非常感谢您的帮助!