Clean Up User-Input & Convert Line-Breaks To BR-tags

A simple PHP function to clean up user input. It does following: converts & to &amp; converts < to &lt; converts > to &gt; converts “ to &quot; and converts line-breaks to <br /> [ad name=”Adsense – text only”] The Function: function clean($str) {     $str = preg_replace(’/&(?!#[0-9]+;)/s’, ‘&amp;’, $str);     $str =… Continue reading Clean Up User-Input & Convert Line-Breaks To BR-tags