question about php decode JSON
Posted
by
cj333
on Stack Overflow
See other posts from Stack Overflow
or by cj333
Published on 2011-01-08T22:11:53Z
Indexed on
2011/01/08
23:54 UTC
Read the original article
Hit count: 205
Hi, I still have some question about php decode JSON. the JSON return like this.
all({"Total":30,"Debug":null,"Documents":[
{
"DocTitle":"Image: A municipal police officer takes positio",
"Docmultimedia":[
{
"DocExpire":"2/7/2011 1:39:02 PM"
}
]
}
...]
});
this is my php code:
foreach ($data->Documents as $result) {
echo htmlspecialchars($result->DocTitle).'<br />';
if(!empty($result->Docmultimedia)){
echo htmlspecialchars($result->Docmultimedia->DocExpire).'<br />';
}
}
It return Warning: Invalid argument supplied for foreach()
.
and echo htmlspecialchars($result->Docmultimedia->DocExpire)
, is it write right? Thanks all.
© Stack Overflow or respective owner