title: How do I make use of postcode regex in PHP?
body: <p>I'm trying to validate a UK postcode. How do I make use of the chosen answer in the following question via PHP?                     </p>
  
  <p><a href="https://stackoverflow.com/questions/164979/regex-for-matching-uk-postcodes">RegEx for matching UK Postcodes</a>   </p>
  
  <pre><code> [Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A- 
      Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9][A-Za-z]?))))\s?[0-9][A-Za-z]{2}
  </code></pre>