note 8404 deleted from function.ereg by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 01:21:34 +0000 |
| Subject: | note 8404 deleted from function.ereg by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20121@lists.php.net to get a copy of this message | ||
Some one asked me to add Canadian Postal Code support to http://www.dtheatre.com formmail so I quickly made a function:
<br>
function canadian_postal($zip) {
if (!eregi("^[a-z][0-9][a-z][[:space:]][0-9][a-z][0-9]$", $zip))
echo "Bad";
else
echo "good";
}
$zip = "V1B 1B1";
echo canadian_postal($zip);
<br>
Enjoy!