json_decode in array php

# 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::
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata,true);
echo “<pre>”;
print_r($obj);
Please follow and like us: