PHP code example of fotografde / xi-sms

1. Go to this page and download the library: Download fotografde/xi-sms 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/ */

    

fotografde / xi-sms example snippets




use Xi\Sms\SmsService;
use Xi\Sms\SmsMessage;
use Xi\Sms\Gateway\MessageBirdGateway;

$gw = new MessageBirdGateway('my_apikey');
$service = new SmsService($gw);

$msg = new SmsMessage('message', 'sender', 'receiver_msisdn');
$service->send($msg);