欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php校验

程序员文章站 2022-06-13 14:01:48
...

//校验 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