簡體   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