简体   繁体   English

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

[英]SMSGATEWAY.ME - Send to more than 2 numbers with PHP API?

Somebody help me please, I am not clear as to send several numbers cell phone, I'm new to 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);
?>

Any help is welcome 欢迎任何帮助

Try this: 尝试这个:

<?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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM