PHP code example of d4h / world-text

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

    

d4h / world-text example snippets


$id = 'XXXXXX'; // Your Account ID
$apiKey = 'XXXXXX'; // Your secret API Key

$sms = WorldText\SmsClient::create($id, $apiKey);

try {
    $info = $sms->send('447989000000', 'Example message');
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getMessage(), "\n";
}