HTML is still reading php code with <!---->

前端 未结 7 1933
感情败类
感情败类 2021-01-14 06:51

I have the following problem. I used the following code in my page to ignore some php code, but it seems that over the Thanksgiving weekend there was an update and it is no

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 07:47

    If you want to ignore the PHP code, its your best bet to do it like this:

    
    

    Whereas /* starts a comment and */ ends it.

    PHP will parse the page before it is sent to the client (or browser). Therefore PHP is not 'interested' in at all.

    On the other hand, if the HTML code that is being included by your call to include() contains further HTML commentary () it may close your ignored code before the point you intended it to.

    UPDATE

    Your overall approach is a bit fuzzy. See here, if you want to use PHP to decide whether to show certain HTML code or not, you don't want to use HTML comments to accomplish that.

    Try this instead:

    
    
    Top Spacer

提交回复
热议问题