September 2001
Intermediate to advanced
768 pages
32h 45m
English
string preg_quote(string input, [string delimiter])
| input | String to escape |
| delimiter | Optional delimiter character to escape |
Escapes all regular expression metacharacters in the input string.
Returns:
String with regular expression metacharacters escaped
Description:
Sometimes it’s necessary to have arbitrarily dynamic strings as parts of the regular expression pattern. These strings may contain characters that have special meaning to the regular expression engine, and for the engine to interpret them literally they need to be escaped, or “quoted.”
This function takes the input string and puts a backslash in front of every character that can be interpreted as part of regular expression syntax. If the optional delimiter parameter ...
Read now
Unlock full access