array_walk_recursive(3) php man page | unix.com

Man Page: array_walk_recursive

Operating Environment: php

Section: 3

ARRAY_WALK_RECURSIVE(3) 						 1						   ARRAY_WALK_RECURSIVE(3)

array_walk_recursive - Apply a user function recursively to every member of an array

SYNOPSIS
bool array_walk_recursive NULL (array &$array, callable $callback, [mixed $userdata])
DESCRIPTION
Applies the user-defined $callback function to each element of the $array. This function will recurse into deeper arrays.
PARAMETERS
o $array - The input array. o $callback - Typically, $callback takes on two parameters. The $array parameter's value being the first, and the key/index second. Note If $callback needs to be working with the actual values of the array, specify the first parameter of $callback as a refer- ence. Then, any changes made to those elements will be made in the original array itself. o $userdata - If the optional $userdata parameter is supplied, it will be passed as the third parameter to the $callback.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1 array_walk_recursive(3) example <?php $sweet = array('a' => 'apple', 'b' => 'banana'); $fruits = array('sweet' => $sweet, 'sour' => 'lemon'); function test_print($item, $key) { echo "$key holds $item "; } array_walk_recursive($fruits, 'test_print'); ?> The above example will output: a holds apple b holds banana sour holds lemon You may notice that the key ' sweet' is never displayed. Any key that holds an array will not be passed to the function.
SEE ALSO
array_walk(3), information about the callback type. PHP Documentation Group ARRAY_WALK_RECURSIVE(3)
Related Man Pages
rsort(3) - php
array_pop(3) - php
array_replace(3) - php
arsort(3) - php
array_filter(3) - php
Similar Topics in the Unix Linux Community
Simple? Search replace
Urgent! need help! how to convert this file into comma delimited format
how to put element of an array to first position.
How to get next string of a matching string?
Replace query by reading the file