exit("<b>HEQEE INFO:</b> " . $msg); } function gbkToUtf8($value) { return iconv("gbk", "UTF-8", $value); } $send = array(); $send['username'] = getval('username') != NULL ? getval('username') : getval('u'); $send['password'] = getval('password') != NULL ? getval('password') : getval('p'); $send['to'] = getval('to') != NULL ? getval('to') : getval('t'); $send['message'] = gbkToUtf8(getval('message') != NULL ? getval('message') : getval('m')); $send['message_len'] = strlen($send['message']); switch ($send) { case $send['username'] == NULL: error('请输入登陆手机的号码.'); break; case $send['password'] == NULL: error('请输入登陆手机的密码.'); break; case $send['to'] == NULL: error('请输入接收手机的号码.'); break; case $send['message'] == NULL: error('请输入短信内容.'); break; case $send['message_len'] > 360: error('消息内容不能超过180个字符.'); break; } $fetion = new fetion($send['username'], $send['password']); $fetion->send($send['to'], $send['message']);
<?php /* 所需PHP扩展:curl, simplexml */ include "libs/fetion.class.php"; #设置飞信帐号密码 $username = "******"; $password = "******"; //接收号码,多号码用","分隔(159..,159..) $sendto = "15900000000,13400000000"; //消息内容 $message = "I am from heqee.com"; //实例化(必须) $fetion = new fetion($username, $password); //发送 返回布尔 $sms = $fetion->send($sendto, $message); if ($sms) { echo "ok"; }