Exemplo n.º 1
0
// 2. require the file
require_once '../YunpianAutoload.php';
// 发送单条短信
$smsOperator = new SmsOperator();
$data['mobile'] = '13300000000';
$data['text'] = '【云片网】您的验证码是1234';
$result = $smsOperator->single_send($data);
print_r($result);
//发送批量短信
$data['mobile'] = '13100000000,13100000001,2,13100000003';
$result = $smsOperator->batch_send($data);
print_r($result);
//发送个性化短信
$data['mobile'] = '13000000000,13000000001,1,13000000003';
$data['text'] = '【云片网】您的验证码是1234,【云片网】您的验证码是6414,【云片网】您的验证码是0099,【云片网】您的验证码是3451';
$result = $smsOperator->multi_send($data);
print_r($result);
//发送指定模板短信(不推荐)
// 模板为【#company#】您的验证码是#code#
// 发送内容:【云片网】您的验证码是1234
//$data['mobile'] = '13400000000,13400000001,1,13400000003';
//$data['tpl_id'] = "1";
//$data['tpl_value'] =
//    urlencode("#code#") . "="
//    . urlencode("1234") . "&"
//    . urlencode("#company#") . "="
//    . urlencode("云片网");
//$result = $smsOperator->tpl_send($data);
//print_r($result);
// 流量
$flowOperator = new FlowOperator();