在PHP中使用<<< CON [英] Using <<<CON in PHP
本文介绍了在PHP中使用<<< CON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码有什么作用?
$page = <<<CON
<p><center>Blah blah blah</center></p>
CON;
<<<CON
的作用是什么?
推荐答案
This is known as heredoc
. It's essentially a way of defining the value of a variable that spans multiple lines, and doesn't require escaping like traditional strings. The "CON" part is merely an identifier that represents the start and end of the value. This can be changed to a more familiar value.
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
这篇关于在PHP中使用<<< CON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文