title: How to preg_match with the pattern being an array (php)
body: <p>Php.net had this preg_replace snippet</p>
  
  <pre><code>$string = 'The quick brown fox jumped over the lazy dog.';
  $patterns = array();
  $patterns[0] = '/quick/';
  $patterns[1] = '/brown/';
  $patterns[2] = '/fox/';
  $replacements = array();
  $replacements[2] = 'bear';
  $replacements[1] = 'black';
  $replacements[0] = 'slow';
  echo preg_replace($patterns, $replacements, $string);
  </code></pre>
  
  <p>Is there a way to run a preg_match on $patterns in order to do something like this</p>
  
  <p>if preg_match found in $string then preg_replace else echo no matched found</p>
  
  <p>Thanks.</p>