How to use PHP to filter metacharacters in input content
Source: Internet
Author: User
How can I use PHP to filter the metacharacters contained in the input content? how can I use PHP to filter the metacharacters contained in the input content, which metacharacters need to be filtered using \ for example '/\? +/', $ Str, which is very good. Let's help you. What functions do you want to implement? Regular expression () GREEDY. * not greedy .*? Security u case sensitive I search using preg_match (how is PHP used to filter the metacharacters contained in the input content?
How to use PHP to filter the metacharacters contained in the input content
------ Solution --------------------
Which metacharacters need to be filtered using \ for example '/\? +/', $ Str
------ Solution --------------------
He is very good at this. Let's help you.
What functions do you want to implement?
Regular expression
()
Greedy .*
Not greedy .*?
Security u
Case Sensitive I
Search with preg_match (regular expression, Target, and result is still an array)
Replace with preg_replace (regular, Target, source)
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