php and newlines: What do I need to know?

advertisements

I have some questions about \r\n:

  • newlines are browser dependent? (not how they are displayed in a browser, but how <textarea> sends them to php via http request)
  • newlines are system dependent? (where php runs)
  • will php apply some implicit conversion?
  • will mysql apply some implicit conversion?

Thanks in advance!


  • newlines are browser dependent?

    • No. Use <br> to get a newline in a browser
  • newlines are system dependent? (where php runs)
    • yes : \n on OSX, \n on Unix/Linux, \r\n on Windows
  • will php apply some implicit conversion?
    • no
  • will mysql apply some implicit conversion?
    • no