preg_replace successful or not
<p>Is there any way to tell if a preg_replace was successful or not?</p>

<p>I tried:</p>

<pre><code>&lt;?php

$stringz = "Dan likes to eat pears and his favorite color is green and green!";
$patterns = array("/pears/","/green/", "/red/");

if ($string = preg_replace($patterns, '&lt;b&gt;\\0&lt;/b&gt;', $stringz, 1)) {
echo "&lt;textarea rows='30' cols='100'&gt;$string&lt;/textarea&gt;";
}else{
    echo "Nope. You didn't have all the required patterns in the array.";
    }

?&gt;
</code></pre>

<p>and yes, I looked at php docs for this one. Sorry about my stupid questions earlier.</p>
