PHP – Protection of special characters of regular expressions
If you want to use a regular expression to, for example, search for a word in a paragraph, it is important to protect your variable. To do this, just use the following function: preg_quote thong ($str thon[, string $delimiter = NULL ]g) For example: foreach ($aReque[‘keywords’]st as $sKeyword) $sKeyword – preg_quote ($sKeyword); $pattern ' ' … Read more