PHP function array_walk()

11. 9. 2019

Availability in PHP 4.0

Apply a user function to every member of an array

Parameters

Parameter Data type Default value Note
$array array not The input array.
$funcname callback not Typically, funcname takes on two parameters. The array parameter's value being the first, and the key/index second.
$userdata mixed null If the optional userdata parameter is supplied, it will be passed as the third parameter to the callback funcname.

Return values

bool

Returns true on success, otherwise false on failure.

Other resources

Official documentation for the array-walk function

Jan Barášek
Jan BarášekVíce o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.