大家哪位高手寫過php調用簡訊介面嗎

來源:互聯網
上載者:User
大家誰寫過php調用簡訊介面嗎?
大家誰寫過php調用簡訊介面嗎,有源碼最好,有適合的簡訊介面也推薦一下,要求:24小時發送,隨發隨到的,做驗證碼用的.

------解決方案--------------------
核心代碼如下:

function rstr($str){
$s=intval(substr($str,0,1));
if($s==1)
$error='代表發送成功';
else{
$b=intval(substr($str,0,2));
switch($b){
case -1:$error='手機號碼不正確';break;
case -2:$error='除時間外,所有參數不可為空';break;
case -3:$error='使用者名稱密碼不正確';break;
case -4:$error='平台不存在';break;
case -5:$error='客戶簡訊數量為0';break;
case -6:$error='客戶賬戶餘額小於要發送的條數';break;
case -7:$error='不能超過70個字';break;
case -8:$error='非法簡訊內容';break;
case -9:$error='未知系統故障';break;
case -10:$error='網路性錯誤';break;
default:$error=false;
}
}
return $error;
}

function sendnote($mobtel,$msg){
$string = file_get_contents("http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=60&username=test1&userpwd=123&handtel=$mobtel&sendcontent=$msg&
sendtime=&smsnumber=0739");
return rstr($string);
}
$msg='內容限制為70個字,';
$msg=mb_convert_encoding($msg, 'gb2312' ,'utf-8');
echo sendnote('手機號',$msg);

56簡訊介面文檔下載地址:

http://www.56dxw.com/Interface/duanxinjiekouxiazai.html

php調用http簡訊介面源碼:http://www.56dxw.com/Interface/202.html

簡訊介面請參考:http://www.56dxw.com
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.