I have a function that's sending a query and receiving an array in the following format:
{
"id1" : 312293.23451244,
"id2" : 6.03937464,
"id3" : 1
}
Using PHP, how could I return the value for "id1"?
Thanks!
I have a function that's sending a query and receiving an array in the following format:
{
"id1" : 312293.23451244,
"id2" : 6.03937464,
"id3" : 1
}
Using PHP, how could I return the value for "id1"?
Thanks!
$data = '{
"id1" : 312293.23451244,
"id2" : 6.03937464,
"id3" : 1
}';
$json = json_decode($data, true);
return $json['id1'];