<?php
function replace_accents($str) {
$str = htmlentities($str);
$str = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde);/','$1',$str);
return html_entity_decode($str);
}
$str = "Th?s ?s ? long str?ng w?th v?r???s ?cc?nts";
$str = replace_accents($str);
echo $str;
?>