I wrote the following code (yes, it works) and wondered why I do not need to hide the '<' and '>' inside the template, since they are considered special characters in the php manual.
http://www.php.net/manual/en/function.preg-quote.php
var_dump(preg_match('/<[A-Za-z][A-Za-z0-9]*>/', "<html>", $matches)); echo "<pre>"; var_dump(htmlentities($matches[0])); echo "</pre>";
exit:
int(1) string(12) "<html>"
Robert rocha
source share