Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts

    echo(htmlspecialchars($message)); shows text in one complete line!

    i have the following code which is showing all the text in a single line.

    i have this in the variable...

    lineone
    linetwo
    linethree


    but then i echo the message prior to inserting in the DB


    it shows like this...


    lineone linetwo linethree


    how do i display it like i typed it with line breaks

    i have tried print, fprint and no luck with them

    plz help

    thanks in advance.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    nl2br() is what you're looking for


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •