【发布时间】:2015-06-07 23:24:09
【问题描述】:
我目前正在使用 clickatell 使用 FOR 方法向单个号码发送消息
for($i = 0;$i < count($textrecievers); $i++){
$url = 'http://api.clickatell.com/http/sendmsg?user=user&password=****&api_id=00000&to=1'.$textrecievers[$i].'&text='.$msgtxt.'&mo=1&from='.$_SESSION['routing'];
$ret = file($url);
}
问题是如果其中一个失败,我无法将其报告给数据库,因为我无法使用此方法
$send = explode(":",$ret[0]);
if ($send[0] == "ID") {
echo 'OK';
}
有什么方法可以像这样将其作为批量文本发送:
$to = array('1111111111','2222222222','3333333333')
然后把它放在usr中
$url = 'http://api.clickatell.com/http/sendmsg?user=user&password=****&api_id=00000&to='.$to.'&text='.$msgtxt.'&mo=1&from='.$_SESSION['routing'];
所以它会在 1 go 时将它发送到数组中的所有数字,所以我可以将它报告为成功与否。
【问题讨论】:
标签: php sms clickatell