Created
February 1, 2011 21:41
-
-
Save psobot/806753 to your computer and use it in GitHub Desktop.
Detects the validity of an Ontario postal code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isOntarioPostalCode($string){ | |
return preg_match("%[PKLNM]\d[ABCEGHJKLMNPRSTVWXYZ]( )?\d[ABCEGHJKLMNPRSTVWXYZ]\d%i"), $string); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment