first of you need to fix this line
its backing on this so u get error page
// Change new lines to <br />. nl2br function probably would work also. It's probably the same as this though. And gets rid of htmlchars. htmlentities screws up the & stuff.
Code:
$content=str_replace(array(' ','','','','','// Change new lines to <br />. nl2br function probably would work also. It's probably the same as this though. And gets rid of
htmlchars. htmlentities screws up the & stuff.'),'',$content);