Consider the following:
$dropdown = array (
"unitofmeasure" => array (
"m" => "meters",
"ft" => "feet"
),
"facing_direction" => array (
"0" => array ("West","North-West","North","North-East","East","South-East"),
"1" => array("South","South-West")
)
....
)
Assume there are n number of sub arrays, not just the two shown above.
Iteration solution:
foreach($dropdown as $key => $val) {
foreach($val as $k => $v) {
foreach($v as $id => $value) {
//manipulate values here
}
}
}
My question is:
is there not a more elegant solution available in PHP?
for example something likeforeach($dropdown->children()->children() ...)
I know there are a few semi-similar questions on SO but they're slightly different and the answers are mediocre.