当前位置:Gxlcms > PHP教程 > heredoc不能用于循环中?该如何处理

heredoc不能用于循环中?该如何处理

时间:2021-07-01 10:21:17 帮助过:27人阅读

heredoc 不能用于循环中?
PHP code
  1. <!--
  2. Code highlighting produced by Actipro CodeHighlighter (freeware)
  3. http://www.CodeHighlighter.com/
  4. -->
  5. $array = array(1,2,3,4);
  6. foreach($array AS $i){
  7. echo <<

出错 Parse error: syntax error, unexpected $end
while for 都会有问题

------解决方案--------------------
HTML;
结束的标记要顶格!

人气教程排行