Forum Moderators: coopster
Here is what I have...
- John
<?php
$fruits = array("Lemony & Fresh","Orange Twist","Apple Juice");$test = array_walk($fruits, 'name_base');
$fruits_fixed = array($test);function name_base($key)
{
$name2 = str_replace(" ", "_", $key);
$name3 = str_replace("&", "and", $name2);
$name4 = strtolower($name3);
echo $name4.'<br />';
return $name4;
}
echo '<br />';
print_r($fruits_fixed);
echo '<br /><br />';
if (is_array($fruits_fixed)) {echo 'is array';}
else {echo 'not array';}
echo '<br /><br />';var_dump($fruits_fixed);
?>
- John
<?php
$fruits = array("Lemony & Fresh","Orange Twist","Apple Juice");print_r($fruits);
echo '<br />';function name_base($key)
{
$name2 = str_replace(" ", "_", $key);
$name3 = str_replace("&", "and", $name2);
$name4 = strtolower($name3);
echo $name4.'<br />';
return $name4;
}
echo '<br />';$test = array_map('name_base', $fruits);
$fruits_fixed = $test;
echo '<br />';
print_r($fruits_fixed);
?>