Send SMS with PHP SMS Script

PHP SMS messaging is one of the services we offer. Here we'll show you how to use our SMS gateway in PHP. Take the SMS PHP script code below to send SMS via Developers' Central. Simply register for an account, and you will automatically receive 100 FREE SMS credits to try our service.


SMS API With Sample Code

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapikey&senderid=TESTIN&channel=OTP&DCS=0&flashsms=0&number=919907922122&text=Test%20from%20smsgatewayhub&route=0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>