<?php if (getenv('REQUEST_METHOD' ) == 'POST') { $postData = file_get_contents("php://input" ); if (!empty($postData)) { $decode =json_decode ($postData); $extracted_data = $decode->D->details; foreach ($extracted_data as $extracted_data_info) {echo $phone_number = $extracted_data_info->number;echo $status = $extracted_data_info->status;echo $track_id = $extracted_data_info->track_id;echo $timesent = $extracted_data_info->timesent;echo $custom_ref = $extracted_data_info->custom_ref;} } } ?>
{
"D":{
"details":[
{
"number":"234XXXXXXXXX",
"status":"DELIVERED",
"track_id":"xxxxxxxxxx",
"timesent":"TIME-MESSAGE-WAS-SENT",
"custom_ref":"xxxxxxxxxx"
}
]
}
}