PHP: JSON çözme sorun

0 Cevap php
<?php
$handle = fopen("https://graph.facebook.com/search?q=sinanoezcan@hotmail.com&type=user&access_token=2227472222|2.mLWDqcUsekDYK_FQQXYnHw__.3600.1279803900-100001310000000|YxS1eGhjx2rpNYzzzzzzzLrfb5hMc.", "rb");
$json = stream_get_contents($handle);
fclose($handle);
echo $json;
$obj = json_decode($json);
print $obj->{'id'};
?>

İşte JSON: {"data":[{"name":"Sinan \u00d6zcan","id":"610914868"}]}

Bu JSON echos ama id baskı yapamaz oldu.

Ayrıca ben denedim:

<?php
$obj = json_decode($json);
$obj = $obj->{'data'};
print $obj->{'id'};
?>

0 Cevap