繁体   English   中英

出于某种原因,当我将它添加到我的代码中时,我收到了意外的文件结尾错误。 但我无法弄清楚这段代码有什么问题

[英]For some reason when i add this to my code I get the unexpected end of file error. But I can't figure out what's wrong with this code

这是产生错误的代码。

<div>
                <?php while($row2 = mysqli_fetch_assoc($get_comment)){?>  
        <div class="comment">
            <p><?php echo $row2['comment']?></p>
        </div>
        <?php}?>
        </div> 

问题在这里<?php}?> 你应该在 php 标签之间使用一个空格,比如<?php } ?>
例如,如果你这样写<?phpecho "Hello";?>这就是无效的。 因为编译器不会找到任何像<?php这样的起始标签,因为它是<?phpecho 在你的情况下它是<?php}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM