- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
<?php
function antihack(&$var){
if(is_array($var)) array_walk($var, 'antihack');
else $var = htmlspecialchars(stripslashes(mysql_real_escape_string($var)), ENT_QUOTES, 'UTF-8');
}
foreach(array('_SERVER', '_GET', '_POST', '_COOKIE', '_REQUEST') as $v){
if(!empty(${$v})) array_walk(${$v}, 'antihack');
}
?>
?
0 =>
array
empty
Выводит:
https://ideone.com/mvg86z