When PHP parses a file, it looks for Start & lt ;? Php and end mark? & Gt; indicates that PHP starts and stops 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. Most cases... "/> SyntaxHighlighter. a when PHP parses a file 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?> When the PHP parser appears in // annotations, it will also think that 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 ). testtest';//preg_match_all('|]+href="([^\"]*)".*?>|', $a, $b);//print_r($b);输出为: :!php preg.php|', $a, $b);//print_r($b);www.2cto.com如何修正上述问题呢?或者你使用/* */进行注释,或者将?>用字符串连接符进行连接,如下: |', $a, $b);print_r($b);这一细节同样适用于JS结束标签《script》
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service