I need to transform an ouput value in array
I have this output
{ "ID":"5454126" ,"class":"ObjectClassRAJ" }
I just need to have the ID "5454126" how can i do it please ?
Thanks
I need to transform an ouput value in array
I have this output
{ "ID":"5454126" ,"class":"ObjectClassRAJ" }
I just need to have the ID "5454126" how can i do it please ?
Thanks
Try json_decode:
<?php
$string = '{ "ID":"5454126" ,"class":"ObjectClassRAJ" }';
$obj = json_decode($string);
print_r($obj);
echo "<br>ID: ".$obj->ID;
echo "<br>class: ".$obj->class;
?>