我目前正在使用 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 时将它发送到数组中的所有数字,所以我可以将它报告为成功与否。