PHP: Returning a value from a non-native array? -
i have function that's sending query , receiving array in following format:
{ "id1" : 312293.23451244, "id2" : 6.03937464, "id3" : 1 }
using php, how return value "id1"?
thanks!
$data = '{ "id1" : 312293.23451244, "id2" : 6.03937464, "id3" : 1 }'; $json = json_decode($data, true); return $json['id1'];
Comments
Post a Comment