About the PHP end tag? & Gt; usage details author: zhanhailiang date: When PHP parses a file, it will look for Start & lt ;? Php and end mark? & Gt; indicates that PHP starts and stops interpreting the code. This method of parsing can embed PHP into a variety of different documents. any content other than a pair of start and end tags will be related to the PHP end tag?> Usage details
Author: zhanhailiang date:
When PHP parses a file, it looks To tell PHP to start and stop interpreting the code.This method can embed PHP into different documents. any content beyond the start and end tags will be ignored by the PHP parser. In most cases, PHP is embedded in HTML documents.
A single-line comment is only commented to the end of the line or the current PHP code block, depending on which one appears first.This means in //...?> Or #...?> The subsequent HTML code will be displayed:?> The PHP mode is jumped out and the HTML mode is returned. // or # does not affect this.
From the above discussion, we can see that,Even if?> In the // annotation, the PHP parser will also think that the PHP parsing is over(When PHP encounters an end Mark?> Then, it simply outputs the original content (unless it is followed by a new line, see the instruction separator) until the next start mark is reached ).
?>|', $a, $b);//print_r($b);
Output:
:!php preg.php|', $a, $b);//print_r($b);
How can I fix the above problems? Or you can use/**/for comments, or set?> Connect with a string connector, as shown below:
?'.'>|', $a, $b);print_r($b);
This details also applyJS end tag script