Simplify this code?
Posted: Sun Feb 17, 2008 7:08 pm
Currently I have somehting like:
Because all I am doing is basically counting the number of elements in each sub-array I would much rather simplify the code and *not* use any foreach if possible.
Can anyone think of a one liner to accomplish this, maybe using a combination of array_map or something?
Code: Select all
foreach($modules as $module => $module_ids){
foreach($module_ids as $module_id => $value){
$module_ids_count++;
}
}Can anyone think of a one liner to accomplish this, maybe using a combination of array_map or something?