1. Go to this page and download the library: Download timefrontiers/php-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/ */
timefrontiers / php-sms example snippets
use TimeFrontiers\Sms\Sms;
Sms::configure([
'db_name' => 'messaging', // database containing the `sms` table
'default_driver' => 'twilio', // fallback driver when no explicit driver is given
'default_sender' => 'MyApp', // default sender ID / phone number
'region_strategy' => 'auto', // 'auto' = use continent mapping; or a fixed driver name
'continent_mapping' => [ // maps continent → driver (used when strategy = 'auto')
'Africa' => 'africastalking',
],
'drivers' => [
'twilio' => [
'sid' => 'AC...',
'token' => 'your-auth-token',
'sender_id' => 'MyApp', // alphanumeric sender ID (if supported)
'sender_phone' => '+1234567890', // fallback long code
],
'africastalking' => [
'app_id' => '...',
'api_key' => '...',
'sender_id' => 'MyApp',
],
// future drivers: just add a key and credentials
],
]);