php校验

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

posted on 2014-10-08 10:11  打补订的僧服  阅读(101)  评论(0编辑  收藏  举报

导航