here the function with str_replace . the search array order must always match the change array (there is an easyer way?):
function filter_text ($original) {
$search = array(
"à", "á", "â", "ã", "ä", "À", "Á", "Â", "Ã", "Ä",
"è", "é", "ê", "ë", "È", "É", "Ê", "Ë",
"ì", "í", "î", "ï", "Ì", "Í", "Î", "Ï",
"ó", "ò", "ô", "õ", "ö", "Ó", "Ò", "Ô", "Õ", "Ö",
"ú", "ù", "û", "ü", "Ú", "Ù", "Û", "Ü",
",", ".", ";", ":", "`", "´", "<", ">", "?", "}",
"{", "ç", "Ç", "~", ""
);
$change = array(
"a", "a", "a", "a", "a", "A", "A", "A", "A", "A",
"e", "e", "e", "e", "E", "E", "E", "E",
"i", "i", "i", "i", "I", "I", "I", "I",
"o", "o", "o", "o", "o", "O", "O", "O", "O", "O",
"u", "u", "u", "u", "U", "U", "U", "U",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", "c", "C", " ", " "
);
$filtered = strtoupper(str_replace($search,$change,$original));
return $filtered;
}