RE: [PHP] I need an array of state abbrev to names...
| From: | Daevid Vincent | Date: | Fri, 18 Aug 2006 03:55:28 +0000 |
| Subject: | RE: [PHP] I need an array of state abbrev to names... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240840@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: tedd [mailto:tedd@sperling.com]
> Sent: Thursday, August 17, 2006 2:54 PM
> To: Daevid Vincent; php-general@lists.php.net
> Subject: Re: [PHP] I need an array of state abbrev to names...
>
> At 12:58 PM -0700 8/17/06, Daevid Vincent wrote:
> >B/c I'm too busy (and lazy) to hand type it all in,
> wondering if someone has
> >an array of state abbreviations to names like so...
> >
> >$states = array(
> >...
> > 'NY' => 'New York',
> > 'WA' => 'Washington',
> >...
> >);
>
> Daevid:
>
> Everything you want should be found here.
>
> http://xn--ovg.com/a_states
>
> If you have any problems with it, please let me know.
>
> Thanks for the exercise.
>
> hth's
>
> tedd
Excellent Thanks! I'd add this to it:
echo("<pre>");
foreach ($abrev as $abbreviation => $statename)
{
echo "'".$abbreviation."' =>
'".ucwords(strtolower($statename))."',\n";
}
echo("</pre>");
Oh, and also that you have to be careful and use the 'save as' feature on
windows machines so as not to get funky "\r\n" instead of "\n" and then the
parser won't work. :)
DÆVID