When I add the less than "<" symbol
$str = 'test';
$str = preg_replace('@(.*)@isu', '<$1', $str);
echo $str; // outputs ""
It should output <test
, but instead outputs nothing.
It works fine when I don't add the character.
$str = 'test';
$str = preg_replace('@(.*)@isu', '$1', $str);
echo $str; // outputs "test"
I tried escaping it
$str = 'test';
$str = preg_replace('@(.*)@isu', '<\\\\$1', $str);
echo $str; // outputs "<\test"
I was unable to find anything about this in the php manual while google just spits out unrelated SO questions.
I would like to know why this does not work?
PHP 5.4.22