PHP array_reduce() functionThe array_reduce() function is a inbuilt function of PHP. The array_reduce( ) function is used to reduce the array to a single value using a callback function. This function was introduced in PHP 4.0.5. SyntaxParameter
Return typeThe array_reduce( ) function returns the reduced result. It can be of any type int, float or string. Example 1Output: 6-PHP-java-python Example 2Output: 21 Example 3Output: start and 15 and 120 and 45 and 320 Example 4Output: 120000
Next TopicPHP Array Functions
|