Hello I have this array and I need the sum of Total:
(
[0] => SimpleXMLElement Object
(
[Code] => 1
[Total] => 28.56
)
[1] => SimpleXMLElement Object
(
[Code] => 2
[Total] => 67.99
)
)
I tried something like this:
$sum = 0;
foreach($myArray as $key=>$value)
{
$sum+= $value;
}
echo $sum;
but it returned a number in new line not summing it
The result should be 96.55
Please help!