You are here: Re: continental state function « All PHP « IT news, forums, messages
Re: continental state function

Posted by Steve on 03/20/07 03:29

<laredotornado@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);
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация