Search code examples
phptextareaeol

What is the official eol value that's sent by browsers (in textarea, for example)


In PHP "\n" acts as the eol for the OS you're on so that's unreliable.

Also, I understand that PHP has constants for EOL, that's not really what I'm asking, I want to know what EOL value I can reliably check for from browsers.


Solution

  • You should take a look at the HTML spec: http://www.w3.org/TR/html401/struct/text.html

    But in a nutshell I believe this will answer your question.

    A line break is defined to be a carriage return (
), a line feed (
), or a carriage return/line feed pair. All line breaks constitute white space.