#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    I want to write files using a form.
    The form contains a textarea.
    <textarea name="TheText" cols=55 rows=12></textarea>

    Now I want to write a file with "<br>" at the end of each line.
    So I can include the file everywhere I want without puting "<br>" at the end of the line at that moment.

    So I want to put "<br>" at the end of the line when I write the file and not when I read the file.

  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,643
    Rep Power
    4492
    use nl2br() before you save your data....only on the text area, though.

    ---John Holmes...

    ------------------
    *************************************************************
    * The manual can probably answer 90% of your questions...
    *
    * PHP Manual. www.php.net/manual
    * MySQL Manual: www.mysql.com/documentation/mysql/bychapter
    *************************************************************
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <textarea name="TheText" cols=55 rows=12></textarea>


    if you are creating a file using the textarea then the n line will be added automatically with each and every line.

    ----
    yeah..if you are trying to add the <br> insted of the n then take a look at nl2br() function.


    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    Ok GREAT!!
    thanx guys
    Ill try it asap.

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Posts
    37
    Rep Power
    26
    Is there an XHTML equivalent to nl2br(), or do I have to write my own? I'm looking for <br /> instead of <BR>.
  10. #6
  11. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,643
    Rep Power
    4492
    Just do a string replace, there's no set function that I know of...

    str_replace("n","<br />",$string);

    ---John Holmes...

IMN logo majestic logo threadwatch logo seochat tools logo