Skip to content

Instantly share code, notes, and snippets.

@fillup
Created April 24, 2016 01:28
Show Gist options
  • Save fillup/bb319433de8aef3d635e881be89fe164 to your computer and use it in GitHub Desktop.
Save fillup/bb319433de8aef3d635e881be89fe164 to your computer and use it in GitHub Desktop.
<?php
use Nexmo\Developer;
use Nexmo\Insight;
use Nexmo\Sms;
use Nexmo\Verify;
use Nexmo\Voice;
/*
* Get an SMS client object
*/
$sms = new Sms([
'api_key' => 'somekey',
'api_secret' => 'somesecret',
]);
/*
* My nexmo number to send from
*/
$myPhone = '11231231234';
/*
* Phone numbers to send message to
*/
$phoneNumbers = [
'1231231233', '2342342345', '3453453456',
];
/*
* Message to be sent
*/
$message = 'Well hello there';
/*
* Send messages to each
*/
foreach ($phoneNumbers as $toPhone) {
$sms->send([
'from' => $myPhone,
'to' => $toPhone,
'text' => $message,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment