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;