PHP短信接口开发 成都短信接口 PHP案例。PHP短信接口开发 成都短信接口 PHP案例,联系专业工程师 QQ467477957
sms.php<?php
if(!empty($_GET['sms'])){
$num = $_GET['num'];
$message = $_GET['message'];
set_phone($num,$message);
}
function set_phone($num,$message){
//header("Content-type: text/html; charset=utf-8");
date_default_timezone_set('PRC'); //设置默认时区为北京时间
//短信接口用户名 $uid
$uid = '';
//短信接口密码 $passwd
$passwd = '';
//$num ='136087976876';
$msg = rawurlencode(mb_convert_encoding($message, "gb2312", "utf-8"));
$gateway = "http://mb345.com:999/ws/Send.aspx?CorpID={$uid}&Pwd={$passwd}&Mobile={$num}&Content={$msg}&Cell=&SendTime=";
$result = file_get_contents($gateway);
if( $result >= 0 )
{
echo $gateway;
echo $result;
echo "发送成功! 发送时间".date("Y-m-d H:i:s");
}
else
{
echo "发送失败, 错误提示代码: ".$result;
}
exit;
}
?>
AD:真正免费,域名+虚机+企业邮箱=0元