php短信接口代码(2)

require 'sms.php'; $sms = new Sms( array('api_key' => '86f52f3ce0647dc24da53eafe29fadd4' , 'use_ssl' => FALSE ) ); //send 单发接口 $res = $sms->send_batch( array('13761428268') , '验证码:19272【脚本之家】'); if( $res ){ if( isset( $res['error'] ) && $res['error'] == 0 ){ echo 'success'; }else{ echo 'failed,code:'.$res['error'].',msg:'.$res['msg']; } }else{ var_dump( $sms->last_error() ); } exit;

4.获取余额示例    

//deposit 余额查询 require 'sms.php'; $sms = new Sms( array('api_key' => '86f52f3ce0647dc24da53eafe29fadd4' , 'use_ssl' => FALSE ) ); $res = $sms->get_deposit(); if( $res ){ if( isset( $res['error'] ) && $res['error'] == 0 ){ echo 'desposit:'.$res['deposit']; }else{ echo 'failed,code:'.$res['error'].',msg:'.$res['msg']; } }else{ var_dump( $sms->last_error() ); } exit;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fdd4e9c190cf059964fa2d3c5661df94.html