I've got a new SMS service for my php app. To send a message you need to go to an URL with the number and message as parameters.
This sms service sucks, is from an external company I know :(
//example.com/sms/?c=number&m=message
With an array of data I made a foreach loop to send each message.
<?php
// Users array
$users[] = ['Jhon', 123456789]
$users[] = ['Peter', 223456789]
$users[] = ['Sam', 323456789]
$users[] = ['Carl', 423456789]
// The loop
foreach ($users as $thisUser) {
// URL builded with the users data
$thisNumber = $thisUser[1];
$thisMessage = 'Hey,+your+name+is+' . $thisUser[0]
$request = sprintf('http://example.com/sms/?c=%d&m=Hey+%s+', $thisNumber, $thisMessage);
}
?>
Now, ¿witch is the best way to go that URL in a loop [several times]? Header redirection doesn't work for me. Maybe cURL...