I am sending bulk SMS with php API through a SMS gatway like this:
http://smsserviceprovider.com/sendsms.php?apikey=xxxx&text=testsms&mobiles=11111,22222,33333,44444,55555,66666....
(upto 1800 mobile numbers which is stored in mysqldb
). But the service provider only allow me to send only 50 mobiles at once. So I have to send SMS in multiple times. How can I split the parameter
mobiles like this
http://smsserviceprovider.com/sendsms.php?apikey=xxxx&text=testsms&mobiles=11111,22222
http://smsserviceprovider.com/sendsms.php?apikey=xxxx&text=testsms&mobiles=33333,44444
http://smsserviceprovider.com/sendsms.php?apikey=xxxx&text=testsms&mobiles=55555,66666....
My current function in php is
function send_sms($message, $numbers) {
$apikey="xxxxx";
$message=urlencode($message);
$var = "apikey=".$apikey."&text=".$message."&mobiles=".$numbers";
$curl=curl_init('http://smsserviceprovider.com/sendsms.php?'.$var);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$response=curl_exec($curl);
curl_close($curl);
return $response;
}