引用了金老师代码,统一用g()方法来获取变量 function g($name, $defaultValue = "") {// php这里区分大小写,将两者都变为小写$_GET = array_change_key_case ( $_GET, CASE_LOWER );$name = strtolower ( $name );$v = isset ( $_GET [$name] ) ?
function g($name, $defaultValue = "") { // php这里区分大小写,将两者都变为小写 $_GET = array_change_key_case ( $_GET, CASE_LOWER ); $name = strtolower ( $name ); $v = isset ( $_GET [$name] ) ? $_GET [$name] : ""; if ($v == "") { $_POST = array_change_key_case ( $_POST, CASE_LOWER ); $v = isset ( $_POST [$name] ) ?$_POST [$name] : ""; } if ($v == "") return $defaultValue; else { // 20141011 jc : js_unescape($v)会引起 where ( col_subject like '%123%' ) 会变成 where ( col_subject like '%3%' ) //$v = js_unescape($v) ; $v = trim($v); return $v; } } }
【相关教程推荐】
1. php编程从入门到精通全套视频教程
2. php从入门到精通
3. bootstrap教程