Skip to content

Instantly share code, notes, and snippets.

@presskey
Last active December 21, 2015 02:09
Show Gist options
  • Save presskey/6232919 to your computer and use it in GitHub Desktop.
Save presskey/6232919 to your computer and use it in GitHub Desktop.
CarouselSMS: sending message using PHP + cURL
<?php
define("API_KEY", 'YOUR_API_KEY');
$message = 'phptest';
$number = '+380501234567';
$url = 'http://sl.carouselsms.com/api/send_message?';
$url .= http_build_query(array(
'api_key' => API_KEY,
'body' => $message,
'phone_number' => $number
));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment