Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sum of array value

$total = 0;
foreach ($products as $product) {
    $subtotal = $product['price']*$product['quantity'];
    $total += $subtotal;
}

echo $total;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #array
ADD COMMENT
Topic
Name
4+5 =