core/funccommon.func.php

Functions

fn_rand()

fn_rand(integer  $num_rand = 32) : void

随机数 fn_rand function.

Parameters

integer $num_rand

(default: 32)

fn_getIp()

fn_getIp() : void

获取 IP fn_getIp function.

fn_captcha()

fn_captcha() : void

验证码校对 fn_captcha function.

fn_token()

fn_token(string  $token_action = 'mk') : void

令牌生成、校对 fn_token function.

Parameters

string $token_action

(default: 'mk')

fn_clearCookie()

fn_clearCookie() 

fn_getSafe()

fn_getSafe(mixed  $str_string, string  $str_type = 'txt', string  $str_default = '') : void

过滤数据 fn_getSafe function.

Parameters

mixed $str_string
string $str_type

(default: 'txt')

string $str_default

(default: '')

fn_strlen_utf8()

fn_strlen_utf8(  $str_string) : void

获取 UTF8 字符长度 fn_strlen_utf8 function.

Parameters

$str_string

fn_substr_utf8()

fn_substr_utf8(mixed  $str_string, mixed  $begin, mixed  $length) : void

fn_substr_utf8 function.

Parameters

mixed $str_string
mixed $begin
mixed $length

fn_page()

fn_page(mixed  $num_count, mixed  $num_per = BG_DEFAULT_PERPAGE,   $method = 'get') : void

分页参数 fn_page function.

Parameters

mixed $num_count
mixed $num_per

(default: BG_DEFAULT_PERPAGE)

$method

fn_jsonEncode()

fn_jsonEncode(string  $arr_json = '',   $encode = false) : void

JSON 编码(内容可编码成 base64) fn_jsonEncode function.

Parameters

string $arr_json

(default: '')

$encode

fn_jsonDecode()

fn_jsonDecode(string  $str_json = '',   $decode = false) : void

JSON 解码 (内容可解码自 base64) fn_jsonDecode function.

Parameters

string $str_json

(default: '')

$decode

fn_eachArray()

fn_eachArray(mixed  $arr, string  $method = 'encode') : void

遍历数组,并进行 base64 解码编码 fn_eachArray function.

Parameters

mixed $arr
string $method

(default: 'encode')

fn_baigoCrypt()

fn_baigoCrypt(mixed  $str,   $salt) : void

密码加密 fn_baigoCrypt function.

Parameters

mixed $str
$salt

fn_regChk()

fn_regChk(mixed  $str_chk, mixed  $str_reg, boolean  $str_wild = false) : void

正则匹配 fn_regChk function.

Parameters

mixed $str_chk
mixed $str_reg
boolean $str_wild

(default: false)

fn_get()

fn_get(mixed  $key) : void

封装 $_GET fn_get function.

Parameters

mixed $key

fn_post()

fn_post(mixed  $key) : void

封装 $_POST fn_post function.

Parameters

mixed $key

fn_cookie()

fn_cookie(mixed  $key,   $method = 'get',   $value = '',   $tm = 3600,   $path = '') : void

封装 $_COOKIE fn_cookie function.

Parameters

mixed $key
$method
$value
$tm
$path

fn_session()

fn_session(  $key,   $method = 'get',   $value = '') 

Parameters

$key
$method
$value

fn_request()

fn_request(mixed  $key) : void

封装 $_REQUEST fn_request function.

Parameters

mixed $key

fn_server()

fn_server(mixed  $key) : void

封装 $_SERVER fn_server function.

Parameters

mixed $key

fn_safe()

fn_safe(  $str_string) 

Parameters

$str_string

fn_htmlcode()

fn_htmlcode(  $str_html,   $method = 'encode',   $spec = false) 

Parameters

$str_html
$method
$spec

fn_strtotime()

fn_strtotime(  $str_time) 

Parameters

$str_time

fn_isEmpty()

fn_isEmpty(  $data) 

Parameters

$data

fn_forward()

fn_forward(  $str_forward,   $method = 'encode') 

Parameters

$str_forward
$method