PHP code example of ashrafi / php-sms-gateway
1. Go to this page and download the library: Download ashrafi/php-sms-gateway 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/ */
ashrafi / php-sms-gateway example snippets
/**
* Created by PhpStorm.
* User: [email protected]
* Date: 4/3/17
* Time: 5:05 PM
*/
$kavenegarConfig=new \Ashrafi\SMSGateway\Gateways\KavenegarConfig();
$kavenegarConfig->setFrom('xyz')->setApiKey('xyz');
$SMSGateway=\Ashrafi\SMSGateway\SMSGateway::getInstance(['kavenegar'=>$kavenegarConfig]);
echo '<pre>';
var_dump($SMSGateway->send('mobile number ','sms text'));
echo '<pre>';
var_dump($SMSGateway->kavenegar->send('mobile number ','sms text'));
echo '<pre>';
var_dump($SMSGateway->tryAll('mobile number ','sms text'));