PHP code example of smspro / sms

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

    

smspro / sms example snippets


	$oMessage = \Smspro\Sms\Message::create('YOUR_PRO_API_KEY');
	$oMessage->from ='SenderId';
	$oMessage->to = '+254712509826,071250xxx';
	$oMessage->message ='Test sms from smspro';
	var_dump($oMessage->send());
  

   $oBalance = \Smspro\Sms\Balance::create('YOUR_PRO_API_KEY');
	$response = $oBalance->get();
	$balance = $response->getBalance();
	$currency = $response->getCurrency();
	$rate = $response->getRate(); 
	echo "Your current balance is {$balance} {$currency} at a rate of {$rate}.\n";