Hello,
With array_walk you can apply a function to each element of an array. Now, that function I wrote called 'create_tag' does refer to another function called 'convert_chars'. That second function seems to be ignored, or not applied. Don't have a clue why.
function convert_chars($text) {
$search = array("é", "è", "à");
$replace = array("e", "e", "a");
$text = str_replace($search, $replace, $text);
return $text;
}
function create_tag(&$item, $key)
{
$item = trim($item);
$item = convert_chars($item);
$item = "<$key>$item</$key>";
}
array_walk($tags,'create_tag');
In human language what I want to do: I want to add tags to each
element of an array, and at the same time convert special characters. But the conversion of the characters seems not to work.
Please help,
Barton