View Single Post
Old 05-25-2011, 09:56 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Why are the states inside of cities? That's craziness.
PHP Code:
foreach($codes['Chicago']['Illinois'] as $school)
{
    
// loop code
}

// or

$city 'Chicago';
$state 'Illinois';
foreach(
$codes[$city][$state] as $school)
{
    
// loop code

You probably want to check to see if the keys exist with isset() or array_key_exists() before looping to prevent potential errors from foreach() if you misspell them.
Inigoesdr is offline  
Users who have thanked Inigoesdr for this post:
mathceleb (05-25-2011)