Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Josh http://sabotagemedia.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

makeSafe

Make data safe...among other things

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;
}
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS