侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

php print EOF实现方法

2023-12-12 星期二 / 0 评论 / 0 点赞 / 55 阅读 / 834 字

我写段php代码如下: 复制代码 代码如下:<? if(test case) print<<<EOT <....html code....> EOF; else print<<<EOT <....html code...

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

广告 广告

评论区