json_decode in array php
As per the documentation, you need to specify if you want an associative array instead of an object from json_decode, this would be the code:
json_decode($jsondata, true);
#EXAMPLE::
$json_string = 'http://www.domain.com/ jsondata.json';
$jsondata = file_get_contents($json_ string);
$obj = json_decode($jsondata,true);
echo "<pre>";
print_r($obj);
No comments:
Post a Comment