Here is what I have and unfortunately it doesn't seem to be a well documented function so a little help would be greatly appreciated.
Code: Select all
<?php
function name_base($name1)
{
$name2 = str_replace(" ", "_", $name1);
$name3 = str_replace("&", "and", $name2);
$name4 = strtolower($name3);
return $name4;
}
echo "Before ...:<br />\n";
print_r($fruits);
array_walk($fruits, 'name_base', 'fruit');
echo "<br />... and after:<br />\n";
$new = array_walk($fruits, name_base);
print_r($new);
?>Before ...:
Array ( [0] => Lemon Fresh [1] => Orange Twist [2] => Banana Blah [3] => Apple Juice )
... and after:
1