php print EOF实现方法

 更新时间:2009年05月21日 12:57:47   作者:  
配对标记名的结尾标记名应单独一行,前后均不允许输出字符...(例如空格等不可见但存在的字符..)
我写段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;
?>

相关文章

最新评论