Sms Integration

How to use any api for sms integration.

PLZ anybody can help…

I’ve never worked with SMS, but I leave 2 links that may be useful:



I hope it helps.

create a simple txt file named smsapi.txt which contain SMS link API.

create one component class so that you can use that in whole application.


class SmsApi  {

	public $r;

        public function init()




        public function sendsms($to,$message)


		$filename = dirname(__FILE__).'/smsapi.txt';

		$fh = fopen($filename, 'r') or die("Can't open file.");

		$msg_api = fread($fh,filesize($filename));


		$update_num = str_replace('MOBILE_NO', $to ,$msg_api);


		$update_msg = str_replace('MESSAGE_CONTENT', $update_msg ,$update_num);




		$update_msg = trim($update_msg);

		$c = curl_init();

		curl_setopt($c, CURLOPT_URL, $update_msg);

		curl_setopt($c, CURLOPT_SSL_VERIFYPEER,false);

		curl_setopt($c, CURLOPT_RETURNTRANSFER,true);




		return $this->r;





now call the function using following code from controller.

$smsobj=new SmsApi;