I'm getting the following sample string through post parameter. I need to get the key value pair from the data to process further. I've used
json_decode($data)
But it throws an error. I copied the string into jsonlint and validated. The string is a valid json
{
"724361997575090":"https:\/\/z-n.ak.fbcdn.net\/photos-h.ak\/hphotos-ak-xpf1\/v\/t1.0-0\/s130x130\/1904241_724361997575090_405663037_n.jpg?oh=6d847393648314f498b0ed5ddec339ca&oe=567A30F3&__gda__=1450240543_9f7147a5699bb9ce03747f5b9f4785f7",
"10201722174609862":"https:\/\/z-n.ak.fbcdn.net\/photos-d.ak\/hphotos-ak-xpf1\/v\/t1.0-0\/s130x130\/996939_10201722174609862_1085044118_n.jpg?oh=43f8044e9b52940c8b6e8bcdf936b139&oe=567D8587&__gda__=1450242029_a3ffb1833c84aabafd50b947963016f4",
"653561304732935":"https:\/\/z-1-scontent.xx.fbcdn.net\/hphotos-xfp1\/v\/t1.0-9\/s130x130\/10262274_653561304732935_4287650319995492122_n.jpg?oh=17d70cf9ec426d0f20070276d626e3ae&oe=567622FD",
"785636858147560":"https:\/\/z-n.ak.fbcdn.net\/photos-g.ak\/hphotos-ak-xtf1\/v\/t1.0-0\/s130x130\/224598_785636858147560_1779521948992015329_n.jpg?oh=8ba4a34102ac9647d70631a2b3b07ef3&oe=5682CF08&__gda__=1450077117_42060c2c51c7dedffc2a12d67a09dddb",
"10152196967129315":"https:\/\/z-1-scontent.xx.fbcdn.net\/hphotos-xft1\/v\/t1.0-9\/s130x130\/10364042_10152196967129315_4825955816401790627_n.jpg?oh=bac0bfcdc4caac23cdbcbf29d9b8e6cb&oe=565FDFA5",
"504111853031524":"https:\/\/z-1-scontent.xx.fbcdn.net\/hphotos-xtf1\/v\/t1.0-9\/s130x130\/1514596_504111853031524_503900941_n.jpg?oh=fe73e70cfd85334374a1c50baabb738e&oe=567DAB84",
"553468811388609":"https:\/\/z-n.ak.fbcdn.net\/sphotos-b.ak\/hphotos-ak-xpa1\/v\/t1.0-9\/s130x130\/935949_553468811388609_410272599_n.jpg?oh=5c6f5d197f01867b7991c2ed0ec5d33c&oe=566E137D&__gda__=1451227136_598cffb867c87e771f21b2ec6d591c2d"
}
Can someone help me on getting the key, value from the above sample?
Error:
Catchable fatal error: Object of class stdClass could not be converted to string
$array = json_decode($data, true);and then doecho $array['553468811388609'];