Jump to content


Photo

adding line break


  • Please log in to reply
3 replies to this topic

#1 masgas

masgas
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 12 October 2006 - 11:15 AM

Hi!

I'm working on a forum. And in the message writing area, when I hit "enter" to place a line break or two, it appears correctly in the text box. However, when I print the messages with php this line break doesn't show...

any ideas why?

thank you for your help.

#2 AndyB

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

Posted 12 October 2006 - 11:25 AM

use the nl2br() function on the output. It converts 'newlines' to html br tags.

echo nl2br($message);

Legend has it that reading the manual never killed anyone.
My site

#3 masgas

masgas
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 12 October 2006 - 11:39 AM

;D

EXCELLENT STUFF

THANK YOU


#4 masgas

masgas
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 12 October 2006 - 11:47 AM

using smilies and formatting text is as simple as that?

do you know of any tutorial for these stuff?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users