I need to get the total value of this array of all the numbers above or equal to 0. This is the array
$aReeks = array(23,245,1,2,12,-10,46,6,66,9999,-55,348,56,6,66,983);
This is the code i have so far, but it only shows the highest number of the array and doesnt count the values up and shows the total.
$totaal = 0;
for($y=0; $y < count($aReeks); $y++)
{
if($totaal < $aReeks[$y] && $aReeks[$y] > 0)
$totaal = $aReeks[$y];
}
I have to do it with a for loop.