array_sum() / count()
Total / count of elements.
Syntax
array_sum($arr) · count($arr)
Description
array_sum sums the numbers; count gives the number of elements.
Example
Loading editor…
Expected output
60 4
When to use?
Cart total, average (sum/count).