HELP! Displaying PARAGRAPHS & double spaces

Discussion in 'PHP' started by buknoii, Oct 9, 2007.

  1. #1
    hello there! im a newbie in php and i would like to ask on how to display a data from a database which consist of 2 spaces or more (<br><br>)

    The out put should be something like this

    HELLO

    WORLD


    but what happens is the output is something like this

    HELLO WORLD

    by the way the code in my script is this

    echo $row["description"];


    any help would be appreciated.
     
    buknoii, Oct 9, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nl2br() is probably what you're looking for.
     
    nico_swd, Oct 9, 2007 IP
  3. buknoii

    buknoii Guest

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks nico.. i just tried that code that you gave me.

    echo nl2br() $row["description"];

    is that correct? coz when i tried it it wont display anything
     
    buknoii, Oct 9, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    It should be this way.
    
    echo nl2br($row["description"]);
    
    PHP:
     
    nico_swd, Oct 9, 2007 IP
  5. buknoii

    buknoii Guest

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks nico! i really appreciate it! its now working :)
     
    buknoii, Oct 9, 2007 IP