How to use PHP to filter metacharacters in input content-php Tutorial

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? solution ------------------ what metacharacters need to be filtered for example? +, $ Str ------ solution -------------------- the seller is very good at this. Let's help you. What functions do you want to implement? Regular expression () GREEDY. * not greedy .*? How to use PHP to filter metacharacters 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)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.