title: Check if postcode is in multiple arrays?
body: <p>I have 3 different areas, MyArea1, MyArea2, MyArea3. Each of these have an array of postcodes:</p>
  
  <pre><code>$myArea1=array("AB1","AC2","AD1");
  $myArea2=array("BC1","BC2","BC3");
  $myArea3=array("CD1","CD2","CD3");
  </code></pre>
  
  <p>The postcodes I need to check would be like the following "BC2 4YZ".</p>
  
  <p>The following won't work as it checks for a complete match:</p>
  
  <pre><code>if (in_array($row['postcode'], $myArea1)) { $Area = 'Area 1'; }
  else if (in_array($row['postcode'], $myArea2)) { $Area = 'Area 2'; }    
  else if (in_array($row['postcode'], $myArea3)) { $Area = 'Area 3'; }
  else { $Area = 'No Match'; }
  </code></pre>
  
  <p>I've got the following that works:</p>
  
  <pre><code>foreach ($myArea1 as $myArea1pc) {
      if (strpos($row['postcode'],$myArea1pc) !== false) {
          $Area = 'Area 1';                   
      }
  }
  </code></pre>
  
  <p>However is there a way of looping this for all of my arrays?</p>
  
  <p>Edit: There may sometimes be postcodes such as "BC24" in my arrays.</p>