php sum array of objects

39

$sum = 0;
foreach($arrObj as $key=>$value){
  if(isset($value->commission))
     $sum += $value->commission;
}
echo $sum;

Comments

Submit
0 Comments