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

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

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

heredoc 不能用于循环中?
PHP code

$array = array(1,2,3,4);
foreach($array AS $i){
    echo <<

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

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

人气教程排行