-2

Can someone tell me the difference in using '\n' and "\n"? Anytime I add '\n' to my php echos the source code doesn't include line breaks, but if I use "\n" it does.

Jesse Elser
  • 964
  • 2
  • 9
  • 34

1 Answers1

2

Single quotes define what is called a literal string, escape sequences will be interpreted literally, for example 'abc\ndef' will literally be interpreted as abc\ndef as opposed to abc<newline>def.

AlphaDelta
  • 2,272
  • 1
  • 18
  • 34
  • Ah. I didn't know there was that big of a difference. I believe it is time to edit some of my codes to improve them. Thanks. – Jesse Elser May 27 '15 at 02:57