xxxxxxxxxx
//Build the url
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
[
'api_key' => API_KEY,
'api_secret' => API_SECRET,
'to' => TO_NUMBER,
'from' => FROM_NUMBER,
'text' => "message body goes here",
'type' => 'unicode'
]
);
// Send the data
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
$response = curl_exec($ch);
// Response
echo $response;