2016-12-27 106 views
-2

我有一个链接,直接从浏览器,这是我们正在使用的短信网关。我试图发送短信到多个数字使用PHP和MySQL作为数据库请帮我完整的代码。使用PHP发送短信给多个号码?

+0

你用Google搜索同样的问题,也有alrady多个帖子,你可以找到。 – Rahul

+0

你的问题太广泛了,你可以使用[curl](http://php.net/manual/en/book.curl.php)! –

+0

你将需要短信网关,它提供'REST Api'来使用php发送短信。 – DD77

回答

0

1.获取阵列中的所有手机号码 2.fetch并运行feach循环 3.put发送代码。 例如:

$data = array('9940272758','213456789','8973557140'); 
foreach($data as $value){ 
    sendapi($value,"hi","somthing"); 
} 
+0

我的链接如下。请帮助我完整的代码。 http://sms.indiabulksms.in/app/smsapi/index.php?key=987654321&campaign=0&routeid=8&type=text&contacts=999999999&senderid=smsing&msg=hello –

+0

感谢您的建议。我在使用您的建议代码时遇到以下错误。 –

0

$result=$array(); //从数据库中获取这里假定它是$result

foreach($result as $mbl){ 
    sendapi($mbl['phone'],$mbl['message']); 
} 
+0

我的链接如下。请帮助我完整的代码。 http://sms.indiabulksms.in/app/smsapi/index.php?key=987654321&campaign=0&routeid=8&type=text&contacts=999999999&senderid=smsing&msg=hello –

+0

感谢您的建议。我在使用您的建议代码时遇到以下错误 –