Created
April 24, 2016 01:28
-
-
Save fillup/bb319433de8aef3d635e881be89fe164 to your computer and use it in GitHub Desktop.
Example for Stack Overflow question: http://stackoverflow.com/questions/36724730/cannot-display-an-overview-of-this-response-error-in-nexmo/36729404
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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