SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hai..
    I have problem in getting contents from textarea in my form.For example: user writes 2 paragraphs, when I try to show it on the next page, that two paragraphs become one paragraph.I would like to get the contents exactly like what user have written.

    I have used : eregi_replace("\n","<BR>",$contents)
    but there is no "\n" in $contents.
    Can you help me???
    ---thanks---

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code:
    $newContents = nl2br( $contents );
    and to get it back again to put in a text box (if you need to):
    Code:
    $contents = eregi_replace( '<br>', "\n", $newContents );
    Hope this helps you.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  3. #3
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you .. thank you !!!
    ---thanks---


Bookmarks

Posting Permissions

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