使用HTTP SMS API向手机发送消息[重复]

This question already has an answer here:

I've purchased access to an API for a SMS gateway so that I can send messages to mobile phones. They gave me a URL, a username and a password. I want to use this in my PHP program.

My SMS gateway provider gave me the following details:

HTTP Api for single or multiple SMS

http://yourURL/api/smsapi.aspx?username=yourUsername&password=yourPassword&to=9xxxxxxxxx,8xxxxxxxxx,7xxxxxxxxx&from=yourSenderId&message=Your message content.
  • username: Your login username.
  • password: Your login password.
  • to: Single mobile number or multiple mobile numbers separated by comma (Only 10 digits).
  • from: Approved sender id (Only 6 characters).
  • message: Your message content (Maximum 459 characters/3 messages).
    • Note: Only 100 mobile numbers are allowed.

I tried many ways to use this, but I couldn't find a solution. How would I implement this in my PHP program?

</div>

use CURL to call api.CURL is better way to call api.

<?php
$url = 'http://yourURL/api/smsapi.aspx?username=yourUsername&password=yourPassword&to=9xxxxxxxxx,8xxxxxxxxx,7xxxxxxxxx&from=yourSenderId&message=Your message content.';

$ch = curl_init(); 
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$output=curl_exec($ch);
if(curl_errno($ch))
{
    echo 'error:' . curl_error($c);
}
curl_close($ch);

?>