Sunday, 18 December 2016

Sum values in foreach loop php closed


<?php

$sum = 0;
$group= array(1,2,3,4);

foreach($group as $key=>$value)
{
   $sum+= $value;
}
echo $sum;
?>


Sum values in foreach loop php closed

No comments:

Post a Comment