- array_walk: documentation ( source)
<?php
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
function test_print($item, $key)
{
echo "$key. $item. bla-bla-bla";
}
echo "Before ...:\n";
array_walk($fruits, 'test_print');
?>