php quotemeta function represents the escape metacharacter set. The syntax of quotemeta is quotemeta(string). The parameter string is required and is the string that needs to be processed.
php How to use quotemeta function?
Function: Add a backslash before the predefined characters
Syntax:
quotemeta(string)
Parameters:
string Required, characters that need to be processed String
Description: This function can be used to escape characters with special meanings, such as ( ), [ ] and * in SQL. This function is binary safe.
php quotemeta() function usage example:
"; echo quotemeta($str2)."
"; echo quotemeta($str3)."
"; echo quotemeta($str4)."
"; ?>
Output:
1 \+ 1 = 2 1 \* 1 = 1 Welcome to php\.cn! Are you ok\?
This article is an introduction to the PHP quotemeta function. I hope it will help you if you need Friends help!
The above is the detailed content of How to use php quotemeta function. For more information, please follow other related articles on the PHP Chinese website!