i get some data with curl from web service and here is my curl code:
$uri="http://test.com";
$ch=curl_init($uri);
curl_setopt_array($ch,array(
CURLOPT_HTTPHEADER=>array('shopid:691','device:2'),
CURLOPT_RETURNTRANSFER=>true
));
$out=curl_exec($ch);
curl_close($ch);
$obj=json_decode($out,true);
print_r($obj);
and my curl out put:
{
"p":
"Serial": "b216"
},
"review": {
"Review": "<div dir=\"rtl\">test</div>
"
},
"likes": 2,
"brand": {
"Name": "test"
},
"followers": [],
"Shop": null
}
i want to get "b216" value in array "p" but i cannot get the value with print_r or echo $obj[0] or echo $obj[0]['Serial']
anyone know how to get this data?