To validate Dutch zipcodes with a regex in PHP, you can use the following regular expression:
main.php51 chars2 lines
This regex matches zipcodes that start with a digit between 1 and 9, followed by three digits between 0 and 9, followed by an optional whitespace character (\s), and finally two uppercase or lowercase letters.
Here is an example implementation:
main.php303 chars13 lines
This function will return true for valid Dutch zipcodes and false for invalid zipcodes.
gistlibby LogSnag