i do not check for get_magic_quotes_gpc is on of off as we should remove all slashes. another thing is to remove slashes using strip slash will only remove "\" to "" and "\\" to "\"
To over come this problem i use str_replace(array( '\\'), '', $v)
Update Example 2
<?php
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][str_replace(array('\\'), '', $k)] = $v;
$process[] = &$process[$key][str_replace(array('\\'), '', $k)];
} else {
$process[$key][str_replace(array('\\'), '', $k)] = str_replace(array('\\'), '', $v);
}
}
}
unset($process);
?>