Questions about the use of single and double quotation marks for strings
Source: Internet
Author: User
Question about using single quotes and double quotes for strings $ pattern_title & nbsp; = '/& lt; TITLE & gt ;(.*?) & Lt; \/TITLE & gt;/iU '; // define a regular expression to obtain the TITLE of a webpage $ result = file_get_contents ($ url ); preg_match_all ($ pattern_t about the single and double quotation marks used for strings
$ Pattern_title = '/ (.*?) <\/TITLE>/iU '; // defines a regular expression to obtain the TITLE of a webpage. <br/> $ result = file_get_contents ($ url ); <br/> preg_match_all ($ pattern_title, $ result, $ title); <br/> The problem is that, in single quotes, it is not necessary to transfer '\' and, how can I add '\' before '/'? <br> ------ solution -------------------- <br> to write it, so you don't need to <br/> '# <TITLE> (. *?)# IU'
Do you understand? If it is not escaped, how do you identify the three delimiters in php?
------ Solution --------------------
Escape any ambiguity
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