PHP code example of itechpk / brandedsms
1. Go to this page and download the library: Download itechpk/brandedsms library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
itechpk / brandedsms example snippets
use Itechpk\Brandedsms\BrandedSms;
//Configuration
$userId = "USER_ID";
$key = "SECRET_KEY";
$mask = "MASK";
//Sms Data
$mobileNo = "92333xxxxxxx";
$msg = "Your message here.";
//creating object
$sms = new BrandedSms();
//setting configuration
$sms->config($userId , $key , $mask);
//sending sms
$sent = $sms->send($mobileNo , $msg);
if($sent)
{
echo "Sms send.";
}
else
{
//$lastCode = null;
//$lastReply = null;
//$lastId = null;
//$lastSts = false;
echo "Sms failed to send.";
}