PHP difference between \r\n and \n

后端 未结 3 1175
一向
一向 2020-12-09 10:25

Simple question...

I have seen people tell me to use \"\\r\\n\" in various places and others tell me to use \"\\n\" in the same place. I\'m sure one is right and one

3条回答
  •  时光说笑
    2020-12-09 10:57

    As per RFC 821 (the SMTP protocol), line endings should always be \r\n () in mail headers and content, but in practice it shouldn't matter as most mail servers handle all three type of line endings correctly (supposedly, some old UNIX-based ones actually choke on \r\n but not \n).

提交回复
热议问题