嗨,我有这个 JSON 响应,我想访问每个页面的图像,当每个页面的 id 未知(随机生成)时,我将如何访问这些图像?
string(310) "{"query":{"redirects":[{"from":"Romerolagus diazi",
"to":"Volcano rabbit"}],
"pages":{"4733563":
{"pageid":4733563,
"ns":0,
"title":"Volcano rabbit",
"images":[
{"ns":6,"title":"File:Question book-new.svg"},
{"ns":6,"title":"File:Romerolagus diazi (dispale) 001.jpg"},
{"ns":6,"title":"File:Status iucn2.3 EN.svg"}
]
}}}}"
我的尝试:
$result = $json->pages[0];
echo "{$result->images}";