File: /home/emblazeone/public_html/master-template/frontend/models/CartCountriesStates.php
<?php
namespace frontend\models;
class CartCountriesStates
{
public static function getCountries(){
return [
"US"=>"United States",
];
}
public static function getStates($country_code){
$states="US;AL;Alabama
US;AK;Alaska
US;AS;American Samoa
US;AZ;Arizona
US;AR;Arkansas
US;AE;Armed Forces Africa
US;AA;Armed Forces Americas
US;AE;Armed Forces Canada
US;AE;Armed Forces Europe
US;AE;Armed Forces Middle East
US;AP;Armed Forces Pacific
US;CA;California
US;CO;Colorado
US;CT;Connecticut
US;DE;Delaware
US;DC;District of Columbia
US;FM;Federated States of Micronesia
US;FL;Florida
US;GA;Georgia
US;GU;Guam
US;HI;Hawaii
US;ID;Idaho
US;IL;Illinois
US;IN;Indiana
US;IA;Iowa
US;KS;Kansas
US;KY;Kentucky
US;LA;Louisiana
US;ME;Maine
US;MD;Maryland
US;MA;Massachusetts
US;MI;Michigan
US;MN;Minnesota
US;MS;Mississippi
US;MO;Missouri
US;MT;Montana
US;NE;Nebraska
US;NV;Nevada
US;NH;New Hampshire
US;NJ;New Jersey
US;NM;New Mexico
US;NY;New York
US;NC;North Carolina
US;ND;North Dakota
US;MP;Northern Mariana Islands
US;OH;Ohio
US;OK;Oklahoma
US;OR;Oregon
US;PA;Pennsylvania
US;PR;Puerto Rico
US;MH;Republic of Marshall Islands
US;RI;Rhode Island
US;SC;South Carolina
US;SD;South Dakota
US;TN;Tennessee
US;TX;Texas
US;UT;Utah
US;VT;Vermont
US;VI;Virgin Islands of the U.S.
US;VA;Virginia
US;WA;Washington
US;WV;West Virginia
US;WI;Wisconsin
US;WY;Wyoming";
$states=explode("\n", $states);
$result=[];
foreach ($states as $row){
$tmp=explode(";",$row);
if(!isset($result[trim($tmp[0])])) $result[trim($tmp[0])]=[];
$result[trim($tmp[0])][trim($tmp[1])]=trim($tmp[2]);
}
if(isset($result[$country_code]))
return $result[$country_code];
else
return [];
}
}