Skip to main content

Timeline for answer to When do I use the PHP constant "PHP_EOL"? by Zoredache

Current License: CC BY-SA 3.0

Post Revisions

17 events
when toggle format what by license comment
Aug 29, 2017 at 20:41 history edited John CC BY-SA 3.0
added 7 characters in body
S Oct 12, 2015 at 7:47 history suggested Abhishek Sachan CC BY-SA 3.0
typos corrected
Oct 12, 2015 at 6:29 review Suggested edits
S Oct 12, 2015 at 7:47
Feb 19, 2014 at 19:27 comment added Celmaun You might use it if you where building up an email to send that needed some formatting. lol what a horrible example, as if the recipient will definitely be using the same OS.
Feb 4, 2014 at 15:14 comment added Lexib0y Yes I meant PHP_EOL. Thanks for the info. I find it difficult to find the relative information in one place, or at all. I never really went into RFCs. Thanks for your answer.
Feb 4, 2014 at 13:33 comment added Halil Özgür @Lexib0y TLDR; no, use CRLF. You mean PHP_EOL, right? According to the latest RFC, no. You should use CRLF there as well. But various email servers and clients might look like tolerating even if you use PHP_EOL (which is CRLF only on Windows and LF on most others), but I still wouldn't rely on them.
Feb 4, 2014 at 11:41 comment added Lexib0y @halil-ozgur is it okay to use PHP_EOF for lines inside a mail body in PHP?
Sep 23, 2013 at 16:29 comment added zloctb Example $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
Mar 15, 2013 at 9:35 comment added Halil Özgür @ring0 unfortunately :) Whenever I need sending emails in PHP, most of the time I end up using Swift Mailer; for infinitely many details of email format requirements and PHP inconsistencies.
Mar 15, 2013 at 8:54 comment added Déjà vu @HalilÖzgür This is true re. the RFC. But unfortunately not true in PHP. And I checked, v5.4.11 has the same code.
Nov 27, 2010 at 13:55 comment added Halil Özgür PHP_EOL should not be used for separating email headers. According to PHP Mail manual, multiple extra headers should be separated with a CRLF (\r\n).
May 17, 2010 at 12:13 comment added Jakob Cosoroaba +1 for mentioning email building $header = "From: $from" . PHP_EOL; $header .= "Reply-To: $from" . PHP_EOL; $header .= "Return-Path: $from" . PHP_EOL;
Feb 2, 2010 at 8:43 comment added Dominic Rodger @Zoredache - the HTML will be generated with newlines appropriate for the platform that PHP is running on, not necessarily appropriate for the platform that you're accessing pages from.
Jan 23, 2010 at 1:18 comment added Zoredache @Rob, If older versions of IE gave me a better page-source viewer then windows notepad I might have agreed with you.
Aug 10, 2009 at 13:44 history edited mercator CC BY-SA 2.5
added 2 characters in body
Apr 21, 2009 at 22:00 comment added Rob You don't need to use platform-independent newlines when generating HTML.
Sep 24, 2008 at 19:35 history answered Zoredache CC BY-SA 2.5