Please talk to me like I am five.
I copied this example from the manual:
<?php
$fruits = array ("lemon", "orange", "banana", "apple");
function test_print ($value, $key)
{echo "$key is $value<br>\n";}
function test_alter (&$item1, $key, $prefix)
{$item1 = "$prefix: $item1";}
array_walk ($fruits, 'test_print');
reset ($fruits);
array_walk ($fruits, 'test_alter', 'fruit');
reset ($fruits); print '<hr color="#000000">';
array_walk ($fruits, 'test_print');
?>
The output is:
0 is lemon
1 is orange
2 is banana
3 is apple
0 is fruit: lemon
1 is fruit: orange
2 is fruit: banana
3 is fruit: apple
I can easily understand the test_print function, but the test_alter function is making me feel like an idiot. Anybody clarify this to me in a more revealing way?
Thank you very much,
Luciano ES
Santos, SP - Brasil