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

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

WBOY
Release: 2016-06-13 13:32:28
Original
909 people have browsed it

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 
Copy after login

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

------解决方案--------------------
HTML;
结束的标记要顶格!
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template