Jump to content


Photo

Formatting and displaying text from database


  • Please log in to reply
2 replies to this topic

#1 trafix

trafix
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 01 June 2006 - 12:52 AM

Ok this is an easy one but i just cant remember who to do it ... lol

now how do i get carriage returns to display in html after the data is retrieved from the database?

\\\\\\\\\\\ example of data ////////////////////

this is
a listing in
a directory

/////////////////////////////////////////////////

if the user edits this info - wrap "physical" is used in the textarea to format the carriage returns ... easy

but....

what do i need to do to get the same format when displaying the info within the ditectory?

currently it displays the string on 1 line eg

this is a listing in a directory


thanks in advance

trafix

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 01 June 2006 - 12:54 AM

nl2br() on the output
Legend has it that reading the manual never killed anyone.
My site

#3 trafix

trafix
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 01 June 2006 - 02:04 AM

[!--quoteo(post=378903:date=May 31 2006, 07:54 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 31 2006, 07:54 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
nl2br() on the output
[/quote]

I knew the solution was there somewhere ... thans Andy :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users