Home >Backend Development >PHP Tutorial > heredoc 不能用于循环中?该如何处理

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

WBOY
WBOYOriginal
2016-06-13 13:32:28906browse

heredoc 不能用于循环中?

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

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

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

------解决方案--------------------
HTML;
结束的标记要顶格!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn