SMSGATEWAY.ME - 使用PHP API发送到2个以上的号码?

时间:2016-10-15 21:41:33

标签: php

有人请帮助我,我不清楚发送几个号码的手机,我是新来的PHP

<?php
include "smsGateway.php";
$smsGateway = new  SmsGateway('my_email_on_their_website','my_password_for_this_account');
$deviceID = 111111;
$number = '+1234567891'; //a single number
$message = 'Hello World!'; //my message
$result = $smsGateway->sendMessageToNumber($number, $message, $deviceID);
?>

欢迎任何帮助

1 个答案:

答案 0 :(得分:0)

试试这个:

<?php
  include "smsGateway.php";
  $smsGateway = new  SmsGateway('my_email_on_their_website','my_password_for_this_account');
  $deviceID = 111111;
  $numbers = ['+1234567891', '+123123123'];
  $message = 'Hello World!'; //my message

  function sendSms() use (&$smsGateway) 
  { 
    return $smsGateway->sendMessageToNumber($number, $message, $deviceID); 
  }

  $results = array_map('sendSms', $numbers);