The array_sum Function in PHP
In PHP, to calculate the sum of array elements,
the array_sum function is used.
See the example:
<?php
$arr = [1, 2, 3, 4, 5];
echo array_sum($arr);
?>
Code execution result:
15
In PHP, to calculate the sum of array elements,
the array_sum function is used.
See the example:
<?php
$arr = [1, 2, 3, 4, 5];
echo array_sum($arr);
?>
Code execution result:
15