As per the documentation, you need to specify true as the second argument if you want an associative array instead of an object from json_decode. This would be the code:
$result = json_decode($jsondata, true);
If you want integer keys instead of whatever the property names are:
$result = array_values(json_decode($jsondata, true));
However, with your current decode you just access it as an object:
print_r($obj->Result);
Answer from Stephen on Stack OverflowAs per the documentation, you need to specify true as the second argument if you want an associative array instead of an object from json_decode. This would be the code:
$result = json_decode($jsondata, true);
If you want integer keys instead of whatever the property names are:
$result = array_values(json_decode($jsondata, true));
However, with your current decode you just access it as an object:
print_r($obj->Result);
try this
$json_string = 'http://www.domain.com/jsondata.json';
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata,true);
echo "<pre>";
print_r($obj);
Videos
I suppose it is understandable after the fact, but PHP's json_encode will convert any array with non-numeric, non-sequential, non-zero-based keys into a JSON object with the specified keys instead of an array. You can get around it by always using array_values() on your array before encoding it when you can't trust it to be sequential. But it does make for an unhappy front-end when you forget and try to use array methods on an object.