关于php中的print EOF

来源:互联网 发布:淘宝上买水果 编辑:程序博客网 时间:2024/06/01 09:24

配对标记名的结尾标记名应单独一行,前后均不允许输出字符...(例如空格等不可见但存在的字符..)

 

我写段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;

?>

 

原创粉丝点击