retrieving and displaying line breaks

This is a discussion on "retrieving and displaying line breaks" within the Databases section. This forum, and the thread "retrieving and displaying line breaks are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 13th, 2007, 08:43
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
retrieving and displaying line breaks

Hi,

I am using this code to retrieve text from a database, but the \r\n are still in the written text. How do I convert this to a linebreak??

Code: Select all
 
<div id='skillsbox'><?php echo nl2br($_SESSION['skills']); ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 13th, 2007, 08:56
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Re: retrieving and displaying line breaks

fixed

Code: Select all
 
echo str_replace(array('\r\n', '\r', '\n'), '<br />', $_SESSION['skills']);
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

Tags
line break mysql

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 Forum 2 Feb 24th, 2008 20:55
Line breaks alexgeek Other Programming Languages 1 Nov 1st, 2007 01:51
eref, textarea, line breaks ppgpilot PHP Forum 2 Jan 20th, 2007 18:13
Setting/Retrieving Cookies Mike Henson Web Page Design 2 Jan 10th, 2006 20:34
Adding RETURN line breaks to a database Lizard- Classic ASP 2 Aug 19th, 2004 09:49


All times are GMT. The time now is 00:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42