本文介绍了在PHP中,“<<<"是什么意思?代表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如:
$sql = <<<MySQL_QUERY
推荐答案
这是heredoc语法.您可以通过在字符串中添加<<<
以及您选择的标记来开始heredoc字符串,并通过仅在新行中放置该标记(而不能做其他任何事情!)来终止它.为方便起见,有一个例外:允许您在结束定界符后添加一个分号.
That's heredoc syntax. You start a heredoc string by putting <<<
plus a token of your choice, and terminate it by putting only the token (and nothing else!) on a new line. As a convenience, there is one exception: you are allowed to add a single semicolon after the end delimiter.
示例:
echo <<<HEREDOC
This is a heredoc string.
Newlines and everything else is preserved.
HEREDOC;
这篇关于在PHP中,“<<<"是什么意思?代表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!