This article introduces a global is also commonly used by a PHP to get the variable value of the method, the need for friends can refer to.
code as follows |
copy code |
"!--? function my_addslashes ($s Tring, $force = 0) { !defined (' MAGIC_QUOTES_GPC ') && define (' MAGIC_QUOTES_GPC ', GET_MAGIC_QUOTES_GPC ()); if (! MAGIC_QUOTES_GPC | | $force) { if (Is_array ($string)) { foreach ($string as $key = + $val) { $string [$key] = My_addslashes ($val, $f Orce); } } else { $string = addslashes ($string); } } return $string; } foreach (Array (' _cookie ', ' _post ', ' _get ') as $_request) { foreach ($$_request as $_key = $_value) { $ _key{0}! = ' _ ' && $$_key = my_addslashes ($_value); } } Echo $urls; ? |
Here we use foreach to traverse the variable to determine if the Cookie,post,get method is used, so that whenever I use the My_addslashes program directly, it will automatically distinguish the value from Post,get,cookie.
http://www.bkjia.com/PHPjc/629120.html www.bkjia.com true http://www.bkjia.com/PHPjc/629120.html techarticle This article introduces a global is also commonly used by a PHP to get the variable value of the method, the need for friends can refer to. Code to copy code as follows? function My_addslashes ( ...)