function foo($y){
global $Arr;
$i = 0;
foreach($Arr[$y] as $Obj){
$i += $Obj->func1();
}
return i;
}
function bar($year){
global $Arr;
$i = 0;
foreach($Arr[$y] as $Obj){
$i += $Obj->func2();
}
return i;
}
The only difference is that they call different function in the foreach loop. Is there any way to combine these? I can do it by passing in a boolean parameter and doing one or the other but i was wondering PHP has something more specific to my need. I have looked but no luck so far.
Thanks,
Nick