I echo some numbers from the database and show only those numbers with a foreach. I now want to calculate the total of these numbers.
$test = str_replace('\\', '', $orderDetails['jsonData']);
$bonbonOrders = unserialize($test);
foreach($bonbonOrders as $bonbonOrder){
foreach($bonbonOrder as $bonbons){
echo $bonbons['gewicht'];
}
}
I tried several things but I really don't know how I can calculate them.
the output for a example can be:
18 15 16 12 11
Thanks!