1. Go to this page and download the library: Download jamal13647850/sms-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/ */
jamal13647850 / sms-api example snippets
use jamal13647850\smsapi\FarazSMS;
use jamal13647850\smsapi\SMS;
// Create a gateway instance (e.g., FarazSMS)
$gateway = new FarazSMS(
'your_username',
'your_password',
'your_sender_number'
);
// Create the SMS service with your chosen gateway
$sms = new SMS($gateway);
// Send a simple SMS
$result = $sms->sendSMS('09120000000', 'Hello, this is a test message');
// Check the result
if ($result['status']) {
echo "SMS sent successfully!";
} else {
echo "Failed to send SMS. Error: " . print_r($result, true);
}
// Check your account balance
$credit = $sms->getCredit();
echo "Your remaining credit: " . $credit;
$result = $sms->sendSMS('09120000000', 'Test message');
// Common fields across all providers
$success = $result['status']; // boolean
$resultCode = $result['resultCode']; // int
$resultData = $result['resultData']; // mixed (can be message ID, array of IDs, etc.)
// Some providers may
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.