i've got a foreach loop and inside the foreach loop i have echo $amount, which gives me seperate numbers from an array.
can anyone tell me how i can add these numbers up so that i can get the total?
my code currently looks like this:
foreach($myArray as $key => $value){
$amount = $myArray[$key];
echo $amount;
}
problem with this code is that i get all the numbers from the array. but i would like to add them up to get a total sum