I have an array of objects, and i want to sum value of one of the property.Here is a picture which will show the structre of array.
Here is my code,that doesn't work.
print_r($res);//this appear the structure of array,which i will show.
$sum = 0;
foreach($res as $key=>$value){
if(isset($value->sent))
$sum += $value->sent;
}
echo $sum;