Methods

getClientIP()

getClientIP() 

dump()

dump(string  $title, mixed  $data) 

助手函数 格式化输出

Parameters

string $title

定位

mixed $data

要打印的内容

get_caller_info()

get_caller_info(  $title = '回溯跟踪',   $isfile = false) 

Parameters

$title
$isfile

input()

input(  $key) 

Parameters

$key

get()

get(  $key = null) 

Parameters

$key

post()

post(  $key = null) 

Parameters

$key

stripSlashesDeep()

stripSlashesDeep(  $value) 

Parameters

$value

removeMagicQuotes()

removeMagicQuotes() 

strip_sql()

strip_sql(  $string) 

Parameters

$string

inject_check()

inject_check(string  $sql_str) : string

过滤SQL注入

Parameters

string $sql_str

Returns

string

RemoveXSS()

RemoveXSS(string  $val) : string

跨站脚本的过滤Xss攻击函数

Parameters

string $val

Returns

string

new_htmlspecialchars()

new_htmlspecialchars(  $string) 

Parameters

$string

new_addslashes()

new_addslashes(  $string) 

Parameters

$string

new_stripslashes()

new_stripslashes(  $string) 

Parameters

$string

strip_textarea()

strip_textarea(  $string) 

Parameters

$string

strip_js()

strip_js(  $string,   $js = 1) 

Parameters

$string
$js

check_email()

check_email(  $email) 

Parameters

$email

check_mobile()

check_mobile(  $mobile) 

Parameters

$mobile

aes_ecryptdString()

aes_ecryptdString(  $str,   $keys = "1034567890666450",   $iv = "1034567890123450",   $cipher_alg = MCRYPT_RIJNDAEL_128) 

实现AES加密 $str : 要加密的字符串 $keys : 加密密钥 $iv : 加密向量 $cipher_alg : 加密方式

Parameters

$str
$keys
$iv
$cipher_alg

aes_decryptString()

aes_decryptString(  $str,   $keys = "1034567890666450",   $iv = "1034567890123450",   $cipher_alg = MCRYPT_RIJNDAEL_128) 

实现AES解密 $str : 要解密的字符串 $keys : 加密密钥 $iv : 加密向量 $cipher_alg : 加密方式

Parameters

$str
$keys
$iv
$cipher_alg

iconv_array()

iconv_array(  $array,   $in_charset,   $out_charset) 

对数组进行转码操作

Parameters

$array
$in_charset
$out_charset

get_code_bynum()

get_code_bynum(  $num) 

Parameters

$num

get_num_bycode()

get_num_bycode(  $str) 

Parameters

$str

passport_encrypt()

passport_encrypt(string  $txt, string  $key = 'IMEMBER_2013') : string

字符串加密函数

Parameters

string $txt
string $key

Returns

string

passport_decrypt()

passport_decrypt(string  $txt, string  $key = 'IMEMBER_2013') : string

字符串解密函数

Parameters

string $txt
string $key

Returns

string

passport_key()

passport_key(  $txt,   $encrypt_key) 

Parameters

$txt
$encrypt_key

imagePathRevise()

imagePathRevise(string  $img_path) 

传入图片的地址,自动修复图片的相对路径(如 ./public/logo.png)到绝对路径(如http://www.imember.cc/public/logo.png)

Parameters

string $img_path

msubstr()

msubstr(  $str,   $start,   $length = 15,   $charset = "utf-8",   $suffix = true) 

Parameters

$str
$start
$length
$charset
$suffix

error()

error(string  $msg, integer  $code, boolean  $islog = false) 

错误信息输出

Parameters

string $msg
integer $code
boolean $islog

是否记录