All pastes #207945 Raw Edit

Something

public text v1 · immutable
#207945 ·published 2006-10-18 09:47 UTC
rendered paste body
function clean($string){ 

$string = addslashes($string); 
# addslashes to prevent SQL injections 

$string = strip_tags($string); 
# strip any tags 

$string = htmlspecialchars($string); 
# set any html left over to special characters 

$string = trim($string); 
# trim the string of any unwanted spaces at the start or end 

$string = mysql_escape_string($string); 

$string = mysql_real_escape_string($string); 

return $string; 
# retrun the cleaned string 
}