<code>$pfName='market_global'; ?> <!-- <?php if(($pfName == 'market_global')) { ?> --> <th style="width: 80px">GG</th> <!-- <?php } else { ?> --> <th style="width: 80px">IOS</th> <!-- <?php } ?> --> </code>
Even if there are comment symbols at work, it still works. Why, even if the comment symbols are removed, it still works????
why??
<code>$pfName='market_global'; ?> <!-- <?php if(($pfName == 'market_global')) { ?> --> <th style="width: 80px">GG</th> <!-- <?php } else { ?> --> <th style="width: 80px">IOS</th> <!-- <?php } ?> --> </code>
Even if there are comment symbols at work, it still works. Why, even if the comment symbols are removed, it still works????
why??
That kind of comment can only work on html
! If you want to comment php
, add a slash inside <?php ?>
. For example<?php //if(($pfName == 'market_global')) { ?>
Try it out
This comment is html code, not php
php code will still be executed
The comment you wrote is an html comment, not a php comment.
The php comments are
/.../
//
I also had this kind of mistake when I first learned PHP.<!---->
is the comment symbol of HTML, which is meant for the browser.
And the PHP interpreter will only recognize // /* */ #
These are PHP comment symbols.