For some reason the following
echo preg_replace("{<!-- *?SC:body:SC *?-->}", 'text text $687 text text', 'text <!-- SC:body:SC --> text text');
returns
text text text 7 text text text text
instead of the expected
text text text $687 text text text text
I understand that $ is a special word in the regular expressions world, but I thought that the regex is the first argument, and then the next two should be treated as plain text?
Anyway, I think that it is stupid - It has caused me a lot of trouble!
Is there any reason for the second and third arguments running through the regex engine?
The soloution - preg_quote()