PHP array_sum() FunctionLast Updated : 17 Mar 2025 The array_sum( ) function is an inbuilt function of PHP. The array_sum( ) function calculates the sum of values in an array and returns the sum of values in an array as an integer or float. This function was introduced in PHP 4.0.4. SyntaxParameters
ReturnThe array_sum( ) function returns the sum of values. Example 1Output: 130 Example 2Output: 0 Example 3Output: 39.7 Example 4Output: 122.12 Next TopicPhp-array-uasort-function |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India