PHP code example of undjike / cleansms

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

    

undjike / cleansms example snippets


use Undjike\CleanSmsPhp\CleanSms;

CleanSms::create()
     ->apiKey('SMS_API_KEY')
     ->email('YOUR_CLEANSMS_EMAIL')
     ->sendSms(
         'MESSAGE_TO_SEND',
         'RECEIVER_PHONE_NUMBER Phone number (Ex: "+237*****") or array of phone numbers (Ex: ["+237*****", "+245*****", ...])'
     );

/**
    Return true if the message is successfully sent, false if not.
    The response can be a JSON in some cases like 'no balance'.
*/

use Undjike\CleanSmsPhp\CleanSms;

CleanSms::create()
     ->apiKey('SMS_API_KEY')
     ->email('YOUR_CLEANSMS_EMAIL')
     ->getCredit();

/**
    Return the number of SMS remaining in your account. (Ex: 44)
*/