0
Thanks

A few words of thanks would be greatly appreciated.

PHP - Whats the difference between \n and \r



Issue


What is the difference between \n (line feed) and \r (carriage return)?
They seems to be exactly the same ... Are there cases where the use of one is better than the other?

Solution


The '\n' is the LF (Line Feed) and '\r' is the CR (carriage return). Under Windows both are required to make a line termination/line break code (LF + CR).
  • Under Unix and Linux system a simple LF is enough to indicate a line break.



Thanks to crabs for this tip.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team

Related

Published by . Latest update on by jak58.

This document, titled "PHP - Whats the difference between \n and \r," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments