I have a dynamic array being created and need to add up all the values for a total value
this is what ive got, but not working..
<?php
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value + $value;
}
?>
the total of the array should = 10 but it equals 8 as im adding the same values together -
Can anyone advice?
cheers for reading
lozza