Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old January 14th, 2009, 06:55 PM   #1
Reputable Member
SuperMember
 

Join Date: Apr 2007
Location: Sydney
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 nate2099 will become famous soon enough
Pesky line breaks won't be removed

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
nate2099 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeing Line Breaks? Jack Franklin PHP 2 February 24th, 2008 04:55 PM
Line breaks alexgeek Other Languages 1 October 31st, 2007 10:51 PM
retrieving and displaying line breaks nate2099 Databases 1 July 13th, 2007 04:56 AM
eref, textarea, line breaks ppgpilot PHP 2 January 20th, 2007 02:13 PM
Adding RETURN line breaks to a database Lizard- Classic ASP 2 August 19th, 2004 05:49 AM


Search Engine Optimization by vBSEO 3.2.0 RC8