Last active
January 27, 2016 07:16
-
-
Save yoosuf/d71ef4402311ec25dc79 to your computer and use it in GitHub Desktop.
Sri Lanka Vehicle Registration Validation - PHP
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 is_plate_valid($number) | |
{ | |
// normal plate | |
if (preg_match("/([A-Z]{2,4}|\d{2,3}|[A-Z]{2} [A-Z]{2})[\-\]|[ ]\d{4}/", $number)) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment