OK so I have this PHP script:
<?php
$stringz = "Dan likes to eat pears and his favorite color is green!";
$patterns = array("/pears/","/green/");
$string = preg_replace($patterns, '<b>\\1</b>', $stringz);
echo "<textarea rows='30' cols='100'>$string</textarea>";
?>
and when I run it I get this:
Dan likes to eat <b></b> and his favorite color is <b></b>!
The is suppose to have a word in it... but it doesn't...
Change \\1
for \\0
.