I have an array like this:
What I want to do is iterate through the array and get the school name of each entry in this main array...but when I do this:
I get 'status', which is the keyname of a property of the school...Am I using foreach wrong here?
Code:
Array
(
[School Name Here ] => Array
(
[status] => private
[Girl's Basketball] => Array
(
[wins] => 16
[losses] => 10
)
[Baseball] => Array
(
[wins] => 11
[losses] => 4
)
)
...more entries
}
What I want to do is iterate through the array and get the school name of each entry in this main array...but when I do this:
Code:
foreach($arr as $school=>$value){
print_r(key($value));
}
I get 'status', which is the keyname of a property of the school...Am I using foreach wrong here?