The nl2br() function - HELP PLEASE! thnx

Discussion in 'PHP' started by Fothy, Aug 2, 2006.

  1. #1
    Hiya

    i posted a previous thread and now have been told that i need to use the nl2br() function to add spacing between paragraphs before i sent a textbox field to a database.

    now, how do i add this function and make it work? coz i really dont have a clue :confused:

    thanks everyone! :)
     
    Fothy, Aug 2, 2006 IP
  2. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming $data is the info you are sending to the database:

    $data = nl2br($data);
     
    Gordaen, Aug 2, 2006 IP
  3. Fothy

    Fothy Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    where would i place tht in my php document tho?
    thnx
     
    Fothy, Aug 2, 2006 IP
  4. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    anywhere after you retrieve the $data and before your mysql query
     
    mxlabs, Aug 2, 2006 IP