<?php
//if $_GET['id'] is set, we know it is delivery report otherwise reply text
if(isset($_GET['id'])) {
    $id = (int)$_GET['id'];  //id-s are allways int
    $status = strip_tags($_GET['status']);
    
    echo 'SMS ID: ' . $id . ' STATUS: ' . $status;
} elseif(isset($_POST)) {
    
    $id = (int)$_POST['smsId'];
    $msg = strip_tags($_POST['m']);
    $fromNumber = $_POST['from']; //replier
    $toNumber = $_POST['to']; //number to which user replied to (can be shared from SMSAPI or own)
    $date = date('Y-m-d', (int)$_POST['time']);
    
    echo 'SMS ID: ' . $id . ' MSG: ' . $msg . ' FROM: ' . $fromNumber . ' TIME: ' . $date;             
}