String 字符串

多行字符串:

http://php.net/manual/zh/language.types.string.php#language.types.string.syntax.nowdoc

DEMO:

  //heredoc 解析变量

<?php
$str = <<<EOD //some codes you want to write //the end of the block should be a new line and have no space EOD; echo $str; ?> <?php
/* newdoc */
$str = <<<'EOD' Example of string spanning multiple lines using nowdoc syntax. EOD;
原文地址:https://www.cnblogs.com/mslagee/p/6141817.html