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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -