PHP code example of orajo / sms-zilla

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

    

orajo / sms-zilla example snippets


$smsSender = new SmsZilla\SmsSender(new SmsZilla\Adapter\MockAdapter());

// default validator supports Polish numbers (PL) without country code
// others must be given with + (plus) sign and country code
// adding one recipient
$smsSender->setRecipient('605123456');
// adding more recipients (with and without country code)
$smsSender->setRecipient(['511654321', '48511654987', '+41751654987']);

// Add recipient from other then default country.
// If region is changed then country code (+41) can be ommited.
$smsSender->getValidator()->setDefaultRegion('CH');
$smsSender->setRecipient('987654321');

$smsSender->setText("Message text");
$result = $smsSender->send();