嘿,我正在尝试从电影 API 获取数据。格式是这样的:
page => 1
results =>
0 =>
adult =>
backdrop_path => /gM3KKixSicG.jpg
id => 603
original_title => The Matrix
release_date => 1999-03-30
poster_path => /gynBNzwyaioNkjKgN.jpg
popularity => 10.55
title => The Matrix
vote_average => 9
vote_count => 328
1 =>
adult =>
backdrop_path => /o6XxGMvqKx0.jpg
id => 605
original_title => The Matrix Revolutions
release_date => 2003-10-26
poster_path => /sKogjhfs5q3aEG8.jpg
popularity => 5.11
title => The Matrix Revolutions
vote_average => 7.5
vote_count => 98
etc etc....
如何仅获取第一个元素 [0] 的数据(如背景路径、原始标题等)?我是 PHP 数组的新手 :)。
当然,这就是我用来输出数组数据的内容:
print_r($theMovie)
任何帮助都会很棒!