title: Use arrays in preg_match()
body: <p>I know you can use arrays with preg_replace but I need to match 2 arrays. 1 array is with forbidden chars and the other is with the variables I want it to find in.
  Basically:</p>
  
  <pre><code>$invalidChars = array("#/#", "#\\#", "#'#", "#\"#");
  $matchIn = array("var1" =&gt; $var1 , "var2" =&gt; $var2);
  </code></pre>
  
  <p>If I do the following to match them:</p>
  
  <pre><code>if(preg_match($invalidChars, $matchIn)){
     echo "Invalid chars found";
     die();
  }else{
     "No invalid chars";
     die();
  }
  </code></pre>
  
  <p>then PHP throws me the following error</p>
  
  <pre><code> Warning: preg_match() expects parameter 2 to be string, array given
  </code></pre>
  
  <p>If it's not possible to use preg_match with 2 arrays how would I check if the variables contain one or more of the invalid charachters? </p>