Why do I get the extra "3" in this replacement?
$s='This is 3a and 3b';
$pattern='/3([a-z])/';
$replace='[$0]';
preg_replace($pattern, $replace, $s) gives 'This is [3a] and [3b]'
I thought $0 refers only to the match in the parenthesis. Same with $replace='[\0]';
I want: 'This is [a] and '
Thanks for any help, no doubt something trivial!