<?php
$username = "ECITES";
    $password = base64_encode(md5("Ken@0704753346"));

    $client_ref = rand(1000, 9999);
    $amount="5";

    $airtime_data = array("username" => $username, "password" => $password, "mobile" => $mobile, "amount" => $amount, "client_ref" => $client_ref);
    $airtime_string = json_encode($airtime_data);

    $URL = "https://isms.advantasms.com/isms/api/sendAirtime";

    //POST
    $ch = curl_init($URL);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $airtime_string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Content-Length: ' . strlen($airtime_string))
    );

    $apiresult = curl_exec($ch);
    echo("API Response: $apiresult\n");

    if (!$apiresult) {
        die("ERROR on URL[$URL] | error[" . curl_error($ch) . "] | error code[" . curl_errno($ch) . "]\n");
    }

    curl_close($ch)
?>