首先有梨類此服務here
而且,這裏是另一種實現方式:
function dosmsend($number, $message, $flash = "") {
// your aql username and password
$username = "yourusername";
$password = "yourpassword";
$weburl = "http://gw1.aql.com/sms/postmsg.php";
// encodes your message for sending on the web
$message = urlencode($message);
// the request string
$smsurl = "$weburl?username=$username&password=$password&to_num=$number&message=$message";
// if $flash is set to 1, it will add the flash request onto the query
if ($flash == "1")
$smsurl .= "&flash=1";
// connects to server to send message
if ($content_array = file($smsurl)) {
$content = implode("", $content_array);
// check for response
if (eregi("AQSMS-AUTHERROR", $content))
echo "There was an authenication error";
elseif (eregi("AQSMS-NOMSG", $content))
echo "There was no message or mobile number";
elseif (eregi("AQSMS-OK", $content))
echo "The Message was queued succcessfully";
elseif (eregi("AQSMS-NOCREDIT", $content))
echo "Your account has no credit";
}
else
echo "There was an error connecting to the server";
}
dosmsend("09978123456", "this is a test message");
//or
//dosmsend("09978123456","this is a test flash message oo!","1");
curl - http://php.net/manual/en/book.curl.php。它看起來可能會讓人感到困惑,但在閱讀了幾個示例之後,您應該可以輕鬆地做出自己想做的事情。 – martincarlin87