What is <<<_END?

前端 未结 5 1355
生来不讨喜
生来不讨喜 2021-01-04 08:45

I\'m new to PHP and don\'t understand what the point of <<<_END is. Could someone please explain when this should be used? I\'ve looked at various exam

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 09:08

    This signifies the beginning of a heredoc (a multi-line string that allows you to use quotation marks in the middle, unescaped) that ends when you encounter the _END

    It can be useful to define HTML in one of these if the goal is to assign it to a variable or pass it to a function rather than printing it to the web server immediately.

提交回复
热议问题