PHP code example of developifynet / sms4connect-php

1. Go to this page and download the library: Download developifynet/sms4connect-php 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/ */

    

developifynet / sms4connect-php example snippets


use Developifynet\Sms4Connect\Sms4Connect;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'to' => '923XXXXXXXXX',                             // You can provide single number as string or an array of numbers
        'msg' => '<PUT_YOUR_MESSAGE_HERE>',                 // Message string you want to send to provided number(s)
        'mask' => '<PUT_YOUR_MASK_HERE>',                   // Use a registered mask with SMS 4 Connect
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
     );
    
    $response = Sms4Connect::SendSMS($SMSObj);
}

use Developifynet\Sms4Connect\Sms4Connect;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'to' => ['923XXXXXXXXX', '923XXXXXXXXX'],,          // You can provide single number as string or an array of numbers
        'msg' => '<PUT_YOUR_MESSAGE_HERE>',                 // Message string you want to send to provided number(s)
        'mask' => '<PUT_YOUR_MASK_HERE>',                   // Use a registered mask with SMS 4 Connect
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
     );
    
    $response = Sms4Connect::SendSMS($SMSObj);
}

use Developifynet\Sms4Connect\Sms4Connect;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'transaction' => 'XXXXXXXXX',                       // You can provide single sms transaction id as string or an array of numbers
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS::checkDeliveryStatus($SMSObj);
}

use Developifynet\Sms4Connect\Sms4Connect;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'transaction' => ['XXXXXXXXX', 'XXXXXXXXX'],        // You can provide single sms transaction id as string or an array of numbers
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS::checkDeliveryStatus($SMSObj);
}

use Developifynet\Sms4Connect\Sms4Connect;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS::checkBalance($SMSObj);
}

use \Developifynet\Sms4Connect\Sms4ConnectSMS;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'to' => '923XXXXXXXXX',                             // You can provide single number as string or an array of numbers
        'msg' => '<PUT_YOUR_MESSAGE_HERE>',                 // Message string you want to send to provided number(s)
        'mask' => '<PUT_YOUR_MASK_HERE>',                   // Use a registered mask with SMS 4 Connect
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS();
    $response = $sms4connect->SendSMS($SMSObj);
}

use \Developifynet\Sms4Connect\Sms4ConnectSMS;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'to' => ['923XXXXXXXXX', '923XXXXXXXXX'],,          // You can provide single number as string or an array of numbers
        'msg' => '<PUT_YOUR_MESSAGE_HERE>',                 // Message string you want to send to provided number(s)
        'mask' => '<PUT_YOUR_MASK_HERE>',                   // Use a registered mask with SMS 4 Connect
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
     );
    
    $sms4connect = new Sms4ConnectSMS();
    $response = $sms4connect->SendSMS($SMSObj);
}

use \Developifynet\Sms4Connect\Sms4ConnectSMS;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'transaction' => 'XXXXXXXXX',                       // You can provide single sms transaction id as string or an array of numbers
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS();
    $response = $sms4connect->checkDeliveryStatus($SMSObj);
}

use \Developifynet\Sms4Connect\Sms4ConnectSMS;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'transaction' => ['XXXXXXXXX', 'XXXXXXXXX'],        // You can provide single sms transaction id as string or an array of numbers
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS();
    $response = $sms4connect->checkDeliveryStatus($SMSObj);
}

use \Developifynet\Sms4Connect\Sms4ConnectSMS;
public function index()
{
    $SMSObj = array(
        'id' => '<PUT_YOUR_ACCOUNT_ID_HERE>',               // Use your account id here
        'password' => '<PUT_YOUR_ACCOUNT_PASSWORD_HERE>',   // Use your account password here
        'test_mode' => '0',                                 // 0 for Production, 1 for Mocking as Test
    );
    
    $sms4connect = new Sms4ConnectSMS();
    $response = $sms4connect->checkBalance($SMSObj);
}
bash
composer