Answer the question
In order to leave comments, you need to log in
How to parse JSON response in a loop?
There is JSON:
Array
(
[0] => stdClass Object
(
[call_id] => 147532********************200
[sip] => 100
[callstart] => 2016-10-01 16:30:36
[clid] => Operator (100)
[destination] => 8***************
[disposition] => answered
[seconds] => 3
[is_recorded] => true
[pbx_call_id] => out_************************************
)
[1] => stdClass Object
(
[call_id] => 14753****************3
[sip] => 100
[callstart] => 2016-10-01 16:31:06
[clid] => Operator (100)
[destination] => 89**************
[disposition] => answered
[seconds] => 2
[is_recorded] => true
[pbx_call_id] => out_**********************************
)
[2] => stdClass Object
(
$answerObject = json_decode($answer);
foreach ($answerObject as $key => $value) {
echo $answerObject->call_id;
}
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