1<?php
2 require('textlocal.class.php');
3 $otp = rand(1000,9999);
4 $textlocal = new Textlocal(false, false,
5 'XXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
6 $phone = '910123456789'; // ISD code prepended
7 $numbers = array($phone);
8 $sender = 'TXTLCL';
9 $message = 'OTP: '.$otp;
10
11 try {
12 $result = $textlocal->sendSms($numbers, $message, $sender);
13 } catch (Exception $e) {
14 $err['error'] = $e->getMessage();
15 }
16?>