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

前端 未结 7 1882
感情败类
感情败类 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:38

    This is an HTML comment. It has no effect on the PHP code.

    You should use PHP comments:

    Block comment:

    /*
    BLOCK OF COMMENTED CODE
    */
    

    Line comment:

    // this is a commented line
    

    The PHP code is interpreted by the server and is calculated "long" before it gets to the users browser. The HTML markup while still on the server, is just text. Only when the HTML arrives at the users browser does it get rendered (or ignored!). So your HTML comments did not matter to the server - it saw PHP code and ran it - the PHP interpreter is not programmed to recognize these strange

    热议问题