Проблема решена, спасибо огромное
Павел Волынцев
Код выглядит так:
<?php
error_reporting(E_ALL);
$message = array(
"username" => "xxxxx",
"password" => md5("xxxx"),
"phone" => "xxxxx",
"text" => "Hello, World!"
);
$messageQuery = http_build_query($message);
echo "init curl\n";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://api.rocketsms.by/simple/send');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $messageQuery);
echo "exec curl\n";
$json = curl_exec($curl);
$result = @json_decode($json, true);
if ($result && isset($result['id'])) {
echo "Message has been sent. MessageID=" . $result['id'];
} elseif ($result && isset($result['error'])) {
echo "Error occurred while sending message. ErrorID=" . $result['error'];
} else {
echo "Service error";
var_dump($json);
}
?>