HEllo.
If I do this..
<div>value | number</div>
<?php
$arr = array(10, 7, 2, 4);
$i = 0;
foreach ($arr as $value) {
$i++;
echo "<p>" . $value . " | " . $i;
}
?>
ill get something like
number | value
1 | 10
2 | 7
3 | 2
4 | 4
How would I make it so the values are added up along the way.. end result being
number | value
1 | 10 //(old value 10)
2 | 17 //(7)
3 | 19 //(2)
4 | 23 //(4)
$value++?
Thanks.