:
$data_array = get_object_vars(json_decode($json_data));
print_r($data_array);
this is only if you obtain information from some web page such as
$data = file_get_contents('http://www.someurl.com/somerestful_url/');
$ data_array = get_object_vars (json_decode ($ data));
print_r ($ data_array);
Also, you probably tried to make json_encode, but instead set json_decode ($ _ POST ['data']);
if you do not have a json string inside $ _POST ['data']; it will not work.
source
share