txt local sms integration in php example
Example: txt local sms integration in php example
<?php
require('textlocal.class.php');
$otp = rand(1000,9999);
$textlocal = new Textlocal(false, false,
'XXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
$phone = '910123456789'; // ISD code prepended
$numbers = array($phone);
$sender = 'TXTLCL';
$message = 'OTP: '.$otp;
try {
$result = $textlocal->sendSms($numbers, $message, $sender);
} catch (Exception $e) {
$err['error'] = $e->getMessage();
}
?>