Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
'CA'=>'CALIFORNIA',
'CO'=>'COLORADO',
'CT'=>'CONNECTICUT',
'DE'=>'DELAWARE',
'DC'=>'DISTRICT OF COLUMBIA',
'FM'=>'FEDERATED STATES OF MICRONESIA',
'FL'=>'FLORIDA',
'GA'=>'GEORGIA',
'GU'=>'GUAM GU',
'HI'=>'HAWAII',
'ID'=>'IDAHO',
'IL'=>'ILLINOIS',
'IN'=>'INDIANA',
'IA'=>'IOWA',
'KS'=>'KANSAS',
'KY'=>'KENTUCKY',
'LA'=>'LOUISIANA',
'ME'=>'MAINE',
'MH'=>'MARSHALL ISLANDS',
'MD'=>'MARYLAND',
'MA'=>'MASSACHUSETTS',
'MI'=>'MICHIGAN',
'MN'=>'MINNESOTA',
'MS'=>'MISSISSIPPI',
'MO'=>'MISSOURI',
'MT'=>'MONTANA',
'NE'=>'NEBRASKA',
'NV'=>'NEVADA',
'NH'=>'NEW HAMPSHIRE',
'NJ'=>'NEW JERSEY',
'NM'=>'NEW MEXICO',
'NY'=>'NEW YORK',
'NC'=>'NORTH CAROLINA',
'ND'=>'NORTH DAKOTA',
'MP'=>'NORTHERN MARIANA ISLANDS',
'OH'=>'OHIO',
'OK'=>'OKLAHOMA',
'OR'=>'OREGON',
'PW'=>'PALAU',
'PA'=>'PENNSYLVANIA',
'PR'=>'PUERTO RICO',
'RI'=>'RHODE ISLAND',
'SC'=>'SOUTH CAROLINA',
'SD'=>'SOUTH DAKOTA',
'TN'=>'TENNESSEE',
'TX'=>'TEXAS',
'UT'=>'UTAH',
'VT'=>'VERMONT',
'VI'=>'VIRGIN ISLANDS',
'VA'=>'VIRGINIA',
'WA'=>'WASHINGTON',
'WV'=>'WEST VIRGINIA',
'WI'=>'WISCONSIN',
'WY'=>'WYOMING',
'AE'=>'ARMED FORCES AFRICA \ CANADA \ EUROPE \ MIDDLE EAST',
'AA'=>'ARMED FORCES AMERICA (EXCEPT CANADA)',
'AP'=>'ARMED FORCES PACIFIC'
);
?>
@nikmclaughlin
Copy link

nikmclaughlin commented Apr 13, 2022

A PHP array of state names and abbreviations but every time there's an 'a' I insert the next lyric to All-Star by Smash Mouth

<?php

/* From https://pe.usps.com/text/pub28/28apb.htm && https://www.google.com/search?q=all+star+lyrics */

$us_state_all_star_names = array(
	'AsomebodyL'=>'AonceLAtoldBAmeMAthe',
	'AworldK'=>'AisLAgonnaSKAroll',
	'AmeS'=>'AiMERICAaintN SAtheMOAsharpest',
	'AtoolZ'=>'AinRIZONAthe',
	'AshedR'=>'AsheRKAwasNSAlookingS',
	'CAkind'=>'CAofLIFORNIAdumb',
	'CO'=>'COLORAwithDO',
	'CT'=>'CONNECTICUT',
	'DE'=>'DELAherWAfingerRE',
	'DC'=>'DISTRICT OF COLUMBIAand',
	'FM'=>'FEDERAherTED STAthumbTES OF MICRONESIAin',
	'FL'=>'FLORIDAthe',
	'GAshape'=>'GEORGIAof',
	'GU'=>'GUAanM GU',
	'HI'=>'HA"L"WAonII',
	'ID'=>'IDAherHO',
	'IL'=>'ILLINOIS',
	'IN'=>'INDIAforeheadNAwell',
	'IAthe'=>'IOWAyears',
	'KS'=>'KAstartNSAcomingS',
	'KY'=>'KENTUCKY',
	'LAand'=>'LOUISIAtheyNAdont',
	'ME'=>'MAstopINE',
	'MH'=>'MAcomingRSHAfedLL ISLAtoNDS',
	'MD'=>'MAtheRYLArulesND',
	'MAand'=>'MAiSSAhitCHUSETTS',
	'MI'=>'MICHIGAtheN',
	'MN'=>'MINNESOTAground',
	'MS'=>'MISSISSIPPI',
	'MO'=>'MISSOURI',
	'MT'=>'MONTArunningNAdidnt',
	'NE'=>'NEBRAmakeSKAsense',
	'NV'=>'NEVAnotDAto',
	'NH'=>'NEW HAliveMPSHIRE',
	'NJ'=>'NEW JERSEY',
	'NM'=>'NEW MEXICO',
	'NY'=>'NEW YORK',
	'NC'=>'NORTH CAforROLINAfun',
	'ND'=>'NORTH DAyourKOTAbrain',
	'MP'=>'NORTHERN MAgetsRIAsmartNAbut ISLAyourNDS',
	'OH'=>'OHIO',
	'OK'=>'OKLAheadHOMAgets',
	'OR'=>'OREGON',
	'PW'=>'PAdumbLAsoU',
	'PAmuch'=>'PENNSYLVAtoNIAdo',
	'PR'=>'PUERTO RICO',
	'RI'=>'RHODE ISLAsoND',
	'SC'=>'SOUTH CAmuchROLINAto',
	'SD'=>'SOUTH DAseeKOTAso',
	'TN'=>'TENNESSEE',
	'TX'=>'TEXAwhatsS',
	'UT'=>'UTAwrongH',
	'VT'=>'VERMONT',
	'VI'=>'VIRGIN ISLAwithNDS',
	'VAtaking'=>'VIRGINIAthe',
	'WAback'=>'WAstreetsSHINGTON',
	'WV'=>'WEST VIRGINIAyoull',
	'WI'=>'WISCONSIN',
	'WY'=>'WYOMING',
	'AneverE'=>'AknowRMED FORCES AifFRICAyou \ CAdontNAgoDAyoull \ EUROPE \ MIDDLE EAneverST',
	'AshineAif'=>'AyouRMED FORCES AdontMERICAglow (EXCEPT CAheyNAnowDAyoure)',
	'AanP'=>'AallRMED FORCES PAstarCIFIC'
);

?>

@technoken35
Copy link

technoken35 commented May 6, 2022

This is not accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment