The given PHP example makes a string as a safe string. Code Example:
<?php // Function for cleaning any input, submitted by any form etc. function clean_input($i){ if(!get_magic_quotes_gpc()) $i = addslashes($i); $i = rtrim($i); $look = array('&', '#', '<', '>', '"', '\'', '(', ')'); $safe = array('&', '#', '<', '>', '"', ''', '(', ')'); $i = str_replace($look, $safe, $i); return $i; } $string = "this & that"; clean_input($string); ?>