Hi - I'm using this code to try and remove line breaks from a string of text:
Code:
$event_description = htmlentities($event_description);
$event_description = nl2br($event_description);
$event_description = str_replace("\r\n"," ",$event_description);
$event_description = str_replace("\n"," ",$event_description);
$event_description = str_replace("\r"," ",$event_description);
$event_description = str_replace("<br />"," ",$event_description);
$event_description = str_replace(chr(13)," ",$event_description);
$event_description = str_replace(chr(10)," ",$event_description);
but they wont disappear. If I view source (notepad) they are removed, but the browser still shows them.
In case it will help here is the text as cut and pasted from the browser:
Code:
dgfhdgh gfhfghdh dghdfgfh dghfhdgh dhdfh dfghdfgh dggdh
and again without the code tags
dgfhdgh gfhfghdh dghdfgfh dghfhdgh dhdfh dfghdfgh dggdh
from the page:
http://www.freelance-crew.com/events.php?action=browse