//校验 function filters($grams){ if(get_magic_quotes_gpc()) { $resgram = trim($grams); $resgram = htmlspecialchars($resgram); } else { $resgram = addslashes(trim($grams)); $resgram = htmlspecialchars($resgram); } return $resgram; } 调用 $c
//校验
function filters($grams){
if(get_magic_quotes_gpc()) {
$resgram = trim($grams);
$resgram = htmlspecialchars($resgram);
} else {
$resgram = addslashes(trim($grams));
$resgram = htmlspecialchars($resgram);
}
return $resgram;
}
调用
$channel_id_g= filters($_SESSION['channel_id_g']);//渠道id
本文原创发布php中文网,转载请注明出处,感谢您的尊重!
博客给出了一段PHP代码,定义了一个名为filters的校验函数。该函数会根据get_magic_quotes_gpc()的返回值进行不同处理,对输入数据进行修剪、转义等操作,最后返回处理后的数据,还展示了函数的调用示例。
1114

被折叠的 条评论
为什么被折叠?



