首页 > 开发 > PHP > 正文

php print EOF实现方法

2024-05-04 22:11:17
字体:
来源:转载
供稿:网友
我写段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;
?>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表