php sum array elements
snippet in php

php sum array elements

user1905

<?php
$a=array(5,15,25);
echo array_sum($a);
?>

php sum array

user6446

number array_sum ( $array )

Input : $a = array(12, 24, 36, 48);
		print_r(array_sum($a));
Output :120

sum of the array elements in php

user2058

Return the sum of all the values in the array (5+15+25):

<?php
$a=array(5,15,25);
echo array_sum($a);
?>