I have this code,
<tr>
<td><?php echo $entry_keyword; ?></td>
<td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
</tr>
<tr>
<td><?php echo $entry_sort_order; ?></td>
<td><input name="sort_order" value="<?php echo $sort_order; ?>" size="1" /></td>
</tr>
and I would love to comment both in one shot…but when I try
<!-- <tr>
<td><?php echo $entry_keyword; ?></td>
<td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
</tr>
<tr>
<td><?php echo $entry_sort_order; ?></td>
<td><input name="sort_order" value="<?php echo $sort_order; ?>" size="1" /></td>
</tr> -->
the page fails – it seems the PHP code is not being commented out… Is there a way to do this?
Instead of using HTML comments (which have no effect on PHP code — which will still be executed), you should use PHP comments:
With that, the PHP code inside the HTML will not be executed; and nothing *(not the HTML, not the PHP, not the result of its non-execution)* will be displayed.
Just one note: you cannot nest C-style [comments][1]… which means the comment will end at the first `*/` encountered.