关于php调用http 56短信接口源码,56短信接口的接入,有不明白之处,可以随时咨询我们技术. 核心代码如下:
核心代码如下:
session_start();
error_reporting(0);
header("content-type:text ml;charset=gb2312");
//帐号配置文件
$comid= "60"; //企业ID
$username= "test1"; //用户名
$userpwd= "qwqwqw"; //密码
$smsnumber= "1061"; //所用平台
function rstr($str){
if($str==1)
$error='代表发送成功';
else{
switch($str){
case -1:$error='根据接口文档返回参数';break;
}
}
print($error);
exit();
}
function sendnote($mobtel,$msg){
global $username,$userpwd,$smsnumber,$comid;
$url = "http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=
$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
$string = file_get_contents($url);
return rstr($string);
echo sendnote("手机号","内容");
}
php 短信接口完整示例下载:
http://www.56dxw.com/down/phpcode.rar
56短信接口文档下载地址:
http://www.56dxw.com/Interface/duanxinjiekouxiazai.html