1

I'm looking at switching from mysql to mysqli, and I came across this page: http://www.codular.com/php-mysqli. I noticed that, instead of using single or double quotes, the author uses "<<<SQL" (three less than signs SQL) and "SQL" to surround his SQL query. Where can I read more about the significance and proper use of this?

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

1

<<< starts a multiline string and is succeeded by the letters that will finish the string. In the case "SQL" on the last line finishes the string.

Look at the accepted answer of Multi-line strings in PHP

Forgot to say about the ;.

Dave Morrissey responded better (oficial reference), but done it on the comment.

Thank you halfer who corrected some mistakes on the first writing.

Community
  • 1
  • 1
fbiazi
  • 387
  • 2
  • 10
  • 1
    Here's the official doc: http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc – Dave Morrissey Aug 08 '14 at 22:14
  • @DaveMorrissey Thank you, I think you should add another answer, because your information is way better than mine. – fbiazi Aug 08 '14 at 22:53