fork(1) download
  1. <?php
  2.  
  3. $answer = '[{"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_************************************"},{"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_**********************************"}]';
  4. $answerObject = json_decode($answer);
  5. print_r($answerObject);
  6. echo '====================================', PHP_EOL;
  7. foreach ($answerObject as $value) {
  8. echo $value->call_id, PHP_EOL;
  9. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
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_**********************************
        )

)
====================================
147532********************200
14753****************3