太阳集团81068网址(中国)有限公司

太阳集团81068网址 > 帮助中心 > 代码示例 > php

php DEMO

php调用示例向客户提供了PHP调用HTTP接口的说明文档和调用示例,以尽可能减少客户开发的难度及工作量。

    
        php
        // $username = "test";         //帐号
        // $password = "111" ;         //密码
        // $mobiles  = "13939393939";  //号码
        // $content  = "测试信息";     //内容

        $username=urlencode(trim($_REQUEST["username"]));
        $password=urlencode(trim($_REQUEST["pwd"]));
        $mobiles=trim($_REQUEST["mobiles"]);
        //$content=urlencode(iconv( "UTF-8", "gb2312//IGNORE" , trim($_REQUEST["contents"])));
        $content=urlencode(mb_convert_encoding(trim($_REQUEST["contents"]),"gb2312" , "utf-8"));

        SendSms($username, $password,$mobiles, $content);
        //发送短信
        function SendSms($username, $password,$mobiles, $content)
        {

        $fp=Fopen("http://api.sms1086.com/api/Send.aspx?username=$username&password=$password&mobiles=$mobiles&content=$content","r");
        $ret = fgetss($fp,255);
        echo urldecode($ret);
        Fclose($fp);
        }
        //修改密码
        function ChgPwd($username, $password,$new_password)
        {
        $fp=Fopen("http://api.sms1086.com/api/ChgPwd.aspx?username=$username&password=$password&newpws=$new_password","r");
        $ret = fgetss($fp,255);
        echo urldecode($ret);
        Fclose($fp);
        }
        //查询余额
        function Query($username, $password)
        {
        $fp=Fopen("http://api.sms1086.com/apiQuery.aspx?username=$username&password=$password","r");
        $ret = fgetss($fp,255);
        echo urldecode($ret);
        Fclose($fp);
        }
        
    

太阳集团81068网址|太阳集团81068网址

XML 地图 | Sitemap 地图