<?php

function sendPostRequest($message="", $url="")
{
    $phone = '919265681856';
    $api = 'https://msgsystem.webplanex.us/api/send-message';
    // Generated @ codebeautify.org
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $api);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt(
        $ch,
        CURLOPT_POSTFIELDS, json_encode(['number'=> $phone, 'message'=> $message, 'fileUrl'=> $url]));
    $headers = [];
    $headers[] = 'Content-Type: application/json';
    $headers[] = 'Authorization: Bearer PlB/ywS7zaAaQ4m3NxezeJIuN2NN5lDohlgATWlcSPg=';
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $result = curl_exec($ch);
    if (curl_errno($ch)) {
         'Error:' . curl_error($ch);
    }
    curl_close($ch);
}
