how preg_replace with $1 or \1 in replacement

Viewed 20

I want to use $1 in replacement.

$replacement = 'Some user content with $1';
$s = preg_replace('|#CONTENT#|', $replacement, 'Bla-bla #CONTENT#');

But I get Bla-bla Some content with instead of Bla-bla Some content with $1

0 Answers
Related