저는 PHP에 익숙하지만 어떻게해야합니까? title
을 volumeinfo
에서 얻을 수 있습니까?foreach가 PHP에서 작동하지 않습니다
Array
(
[kind] => books#volumes
[totalItems] => 595
[items] => Array
(
[0] => Array
(
[kind] => books#volume
[id] => Aaug_RnI-xQC
[etag] => E1EIADudeHY
[selfLink] => https://www.googleapis.com/books/v1/volumes/Aaug_RnI-xQC
[volumeInfo] => Array
(
[title] => The Irresistible Rise of Harry Potter
[authors] => Array
(
[0] => Andrew Blake
)
[publisher] => Verso
[publishedDate] => 2002
[description] => As the British state begins to unravel, and as journalists compete to pronounce on the death...
도와주세요.
echo $array['items'][0]['volumeInfo']['title'];
또는 배열을 가정 foreach
foreach($array['items'] as $items) {
echo $items['volumeInfo']['title'];
}
'의 foreach ($ 항목으로 $ 배열 [ '항목'])을 사용할 수있다 [ 'volumnInfo'] '표제']; }' –
지금까지 해보신 것은 무엇입니까? 사용하려고 시도한 코드의 예제와 그 결과로 보았던 오류를 게시하십시오. 우리는 당신에게 답을 줄 수 있지만, 우리가 당신을 도와 줄 수 있다면 더 좋습니다. –