PHP code example of kkamkou / sms-online-api

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

    

kkamkou / sms-online-api example snippets


$sms = new \SmsOnline\Api(array('api' => array('user' => '', 'secret_key' => '')));
$sms->send('76543210987', 'TestMessage');
$sms->send('76543210987', 'TestMessage', array('from' => 'MySite'));

$client = new MyClient(array('timeout' => 40));
$sms = new \SmsOnline\Api(array('client' => $client));

$result = $sms->send('76543210987', 'TestMessage');
if ($result->isSuccessful()) {
  print_r($result->toArray());
  echo (string)$result;
}

$sms = new \SmsOnline\Api(
    array(
        'client' => array(
            'cainfo' => 'pathToCert'
            // or you can disable ssl verification (bad idea)
            //'ssl_verifyhost' => 0,
            //'ssl_verifypeer' => 0
        )
    )
);