php校验

WBOY
WBOY原創
2016-06-06 19:45:191541瀏覽

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn