php print EOF实现方法

网络编程 发布日期:2024/10/12 浏览次数:1

正在浏览:php print EOF实现方法
我写段php代码如下:
复制代码 代码如下:
<?
if(test case)
print<<<EOT
<....html code....>
EOF;
else
print<<<EOT
<....html code....>
EOF;
?>

如上写法是不可以的,需要把EOF标识符顶格:
复制代码 代码如下:
<?
if(test case)
print<<<EOT
<....html code....>
EOF;
else
print<<<EOT
<....html code....>
EOF;
?>