Sum values in foreach loop _php

http://stackoverflow.com/a/16535758/5530859

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

Comments

Post a Comment

Popular posts from this blog

Git post receive setup at server for git push to the production from local machine

Deploy laravel application to digital ocean droplet