/** * gbk字符转utf8字符 * @param void $data * @return void */ public static function gbkToUtf8($data) { foreach ($data as $k => $v) { if (is_array($v)) { $data[$k] = gbkToUtf8($v); } else { $data[$k] = iconv('gbk', 'utf-8', $v); } } return $data; }
return $_POST[$key] != '' && isset($_POST[$key]) ? trim($_POST[$key]) : NULL; } } function error($msg) { 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: