SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    865
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Finding what kind of line endings are stored in the database

    I have a form on my website where users can enter multiple paragraphs of text which get inserted into a mySQL database. What is the best way in PHP to show the hidden line endings like \n as well as \r ? I ask this because I go in to my database client and enter paragraphs myself, and it is apparently using different line endings than what the html form is using.

    I need to figure this out so I can use a PHP function called nl2p, which takes text from the database and puts it into proper html paragraph tags. I need all the paragraphs in my database to consistently use the same type of line endings for this function to work correctly.

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    this is why nl2br was added
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


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
  •