I'd like to build an array that will store not only city names but also state. TGhe use this array to build a drop-down list of cities and when submitted by a form to be able to capture both city and state.
I was thinking something along these lines:
$locale= array(
"TX:Austin" => "Austin",
"IL:Chicago" => "Chicago",
"TX:Dallas" => "Dallas",
"TX:Houston" => "Houston",
"CA:Los Angeles" => "Los Angeles",
"CA:SanFrancisco" => "San Francisco");
So when it is submitted I need to get
$state = 'TX';
$city = 'Dallas';
However I'm not sure how to accomplish that... Any suggestions?