Here is the json show:
{
"results": [
{
"title": "Conflicting Reports on Iran\u2019s Arrest of a Foreign Woman",
"multimedia":[
{
"caption": "Moktada al-Sadr spoke to thousands of supporters on Saturday, stating conditional support for the Iraqi government."
}
]
}
...]
}
I tried this code, but I can not get the `caption` part. How to do correctly? Thanks.
foreach ($data->results as $result) {
echo '<p>'.htmlspecialchars($result->title).'</p><br />';
if(!empty($result->multimedia)){
echo '<p>'.htmlspecialchars($result->multimedia->caption).'</p><br />';
}
}