Q:

PHP preg_quote() and less-than sign

echo preg_quote("aaa<bbb");

should write:
aaa\<bbb

but I get:
aaa\

This is the only sign that makes problems.

A:

If you want to display it in browser what it just is, you could wrap it in <pre> tag.
echo '<pre>'.preg_quote("aaa<bbb").'</pre>';

Or you could use htmlspecialchars to escape the <.
echo htmlspecialchars(preg_quote("aaa<bbb"));

