I noticed someone using preg_replace() with double backslashes to escape, (e.g., <\\/div>
instead of <\/div>
).
Is this necessary? I tried both ways and I don't see what's the difference.
simple example...
preg_replace('/<div>\\s*text<\\/div>/', '', $somestring);
vs
preg_replace('/<div>\s*text<\/div>/', '', $somestring);