<?php
$json = <<<JSON
{
"event_type": "IncomingCallEnd",
"account_id": 55555,
"did_num": "88001234567",
"did": "7123456789",
"call_id": "1588984514.9676405",
"abon": "103",
"billsec": "19",
"secret": "4ff8rZbTZ0TllXL"
}
JSON;
$jsonString = $json;
$call = json_decode($jsonString);
$call->did_num = substr_replace(trim($call->did_num),'7',0,1);
print_r($call);
print_r($call->did_num);
- Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- stdClass Object
(
[event_type] => IncomingCallEnd
[account_id] => 55555
[did_num] => 78001234567
[did] => 7123456789
[call_id] => 1588984514.9676405
[abon] => 103
[billsec] => 19
[secret] => 4ff8rZbTZ0TllXL
)
78001234567
preferences:
142.74 ms | 408 KiB | 5 Q