Using a Third Party API to Send SMS with PHP (SMS) free download code 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();
	}
?>

Tags:

Java Example