Access inner array in php -
i have folowing array:
outerarray{ "id": "20154", "from": { "name": "xyz", "id": "10004" }} now how access element name?
it json, decode first using json_decode() , access:
$arr = json_decode($yourjson, true); echo $arr['from']['name']; // xyz or
$arr = json_decode($yourjson); echo $arr->from->name; // xyz
Comments
Post a Comment