Rate this script:  I Love it  /   I Hate it

makeSafe


Code


function makeSafe($variable) {
        $variable = htmlentities($variable, ENT_QUOTES);
       
        if (get_magic_quotes_gpc()) {
                $variable = stripslashes($variable);
        }
       
        $variable = mysql_real_escape_string(trim($variable));
        $variable = strip_tags($variable);
        $variable = str_replace("\r\n", "", $variable);
        
        return $variable;
}
 

 

 
makeSafe scripts | makeSafe snippet | makeSafe example | makeSafe tutorial | makeSafe code