Answer the question
In order to leave comments, you need to log in
How to parse multidimensional json array in php?
Good afternoon, I receive a json array of the following form via rest api.
data {
calls
{
"id": "7e734dc1-544d-4f04-8ccc-8bd5b197a88c",
"caller":
{
"name": "u2 u2",
"extension": "101"
},
"called":
[
{
"isConnected": true,
"name": "akmightycall4 akmightycall4",
"extension": "100"
},
{
"isConnected": false,
"name": "u3 u3",
"extension": "102",
"phone": "+75551112235"
}
],
"businessNumber": "+74950152729",
"dateTimeUtc": "2018-06-05T13:38:29.522Z",
"duration": "23066",
"direction": "Outgoing",
"callStatus": "Connected",
"callRecord":
{
"fileName": "records/T1U9Y5b197a88c.wav",
"uri": "http://localhost/u2.wav?recordid=fdaVn2YWttaWdodHljYWxGV20"
}
}
}
$json = json_decode($result, true);
foreach($json['data']['calls'] as $item) {
print $item['id'];
print '<br>';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question