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;
 &
Submit an Idea
  Thank you for your valuable feedback.
Your E-mail (optional):
Select Option:
Description:
 
Feedback
Your Name / email address
Feedback as
Your feedback
close
Quickly sign in with:

Create a FATALWEB account here:

First name:

Last name:

E-mail address:

Join Fatalweb

Already have a fatalweb account? Log in here