|
Posted by laredotornado@zipmail.com on 03/21/07 22:21
On Mar 19, 10:29 pm, "Steve" <no....@example.com> wrote:
> <laredotorn...@zipmail.com> wrote in message
>
> news:1174344110.918327.309280@n59g2000hsh.googlegroups.com...
> | Hi,
> |
> | Using PHP 4.4.4. Does anyone have a pre-written function that tests
> | whether a two letter abbreviation is in the continental United
> | States? At first I wrote my function to check against inequality with
> | "AK" and "HI", but that neglects the territories and protectorates,
> | and some people will enter those in as abbreviations (e.g. "VI",
> | Virgin Islands) in our shopping cart.
>
> this function is quite easy to understand:
>
> function isState($abbreviation)
> {
> $states = array(
> 'AL' ,
> 'AK' ,
> 'AZ'
> // and so on ...
> );
> return in_array($abbreviation, $states);
>
> }
Thanks but what I was selfishly hoping was that someone could list
those out. It is a pain to cut and paste and type. - Dave
[Back to original message]
|