Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

if data come from foreach loop and if there are same value then sum of this same value and pass it to variable in php

$sum = 0;
foreach($group as $key => $value) {
   $sum += $value; 
}
echo $sum;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #data #foreach #loop #sum #pass #variable #php
ADD COMMENT
Topic
Name
5+9 =