Difference between \ r \ n and \ n \ n in php email

I am setting up php mail sending script ...

When adding different headers, I came across a character for a new line in the letter (since the <br> tag will not do) ...

So my question is, what is the difference between \ r \ n and \ n \ n?

eg:

echo $var1 . " \r\n" . $var2 . "\n\n";

thank you for your help!

+3
source share
7 answers

\r \n . , , \r - ( , ???) , , \n . , \n .

+4

\r\n .

RFC 2822

.     ,     line-feed; (CR) (ASCII     13), (LF) (ASCII     10). ( /     "CRLF".)

\n\n - 2 .

, ,

echo $var1 . " \r\n" . $var2 . "\r\n\r\n";

\r\n\r\n - . HTTP SMTP

+7

\r\n - , \n\n - UNIX- .

, HTML. , , .

. Newline

+2

\r\n Windows . unix - \n.

( ) \r \n . , \n\n .

+2

"\r\n" DOS, UNIX - "\n". , "\n\n" UNIX, . PHP, PHP PHP_EOL.

+1

\r . \n .

0

All Articles