Will PHP start searching for parsing files? Php and end mark ?, Mark to tell PHP to start and stop interpreting the code, next, I will introduce in detail the use of PHP end labels. if you are interested, you can refer to this article, which may help you find the starting point 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 ).
The code is as follows:
// $ A = 'testtest ';
// Preg_match_all ('|] + href = "([^ \"] *) ". *?> | ', $ A, $ B );
// Print_r ($ B );
Output:
The code is as follows:
:! 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:
The code is as follows:
$ A = 'testtest ';
Preg_match_all ('|] + href = "([^ \"] *) ". *? '.'> | ', $ A, $ B );
Print_r ($ B );
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