This article delves into the use of the end tag in PHP, as well as the related details of the problem, with the need for a friend to refer to. We know that PHP will look for the start, PHP and end tags when parsing the file?. These tokens tell PHP to start and stop explaining the code in it. This way of parsing allows PHP to be embedded in a variety of documents that are ignored by the PHP parser in the case of anything other than a pair of start and end tags. In most cases, PHP is embedded in an HTML document. The Single-line comment only comments to the end of the line or the current PHP code block, depending on which first appears. This means that in//...? > or # ...? The HTML code after > is displayed:?> jumps out of PHP mode and returns to HTML mode,//or #并不能影响到这一点. Even if?> appears in//comments, the PHP parser will assume that the PHP parsing is finished (when PHP touches the end tag?>, it outputs the contents as is (unless followed by a new line, see instruction Delimiter) until the next start tag is encountered). Example: | ', $a, $b); Print_r ($b); Output: :!php preg.php | ', $a, $b); Print_r ($b); The can be commented by using the/* * or by connecting the?> with a string connector to fix the above problem, for example: | ', $a, $b); Print_r ($b); Description: This detail also applies to the JS end tag. |