I got a problem with str_replace, if you try the code below you'll see it doesn't return the assigned pronunciation correctly, and I don't know what's going wrong.
I wonder if somebody can tell me what's going wrong and how I can solve it?
function abc_pronunciation($incoming_input)
{
$arr_search = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr_replace = array(' ay ',' be ',' ce ',' dee ',' ee ',' aef ',' gee ',' aich ',' ii ',' jay ',' kay ',' el ',' em ',' en ',' oh ',' pee ',' qu ',' ar ',' as ',' tee ',' yu ',' vee ',' doble-yu ',' ex ',' ye ',' zee ');
$output = str_replace($arr_search,$arr_replace,$incoming_input);
echo $output;
}
$input = "barcelona";
abc_pronunciation($input);