PHP » array_reduce
Iteratively reduce the array to a single value using a callback function
array_filter() - Filters elements of an array using a callback function array_map() - Applies the callback to the elements of the given arrays array_unique() - Removes duplicate values from an array array_count_values() - Counts all the values of an arra
| Parameters | Description |
|---|---|
| input | The input array. |
| function | The callback function. |
| initial | If the optional initial is available, it will be used at the beginning of the process, or as a final result in case the array is empty. |
Example
<?php
function rsum($v, $w)
{
$v += $w;
return $v;
}
function rmul($v, $w)
{
$v *= $w;
&

