3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = '""COMERI"" SANATORIO COOP. MEDICA'; $b = 'CABA├â?A ""LA CACHIMBA"" DE INES BO'; function clean($string) { $string = str_replace('"', ' ', $string); // Replaces all spaces with hyphens. //return str_replace('"', ' ', $string); // Replaces all spaces with hyphens. return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. } function decodeTildes($cadena) { return str_replace(array('&aacute;', '&eacute;', '&iacute;', '&oacute;', '&uacute;', '&ntilde;', '&Aacute;', '&Eacute;', '&Iacute;', '&Oacute;', '&Uacute;', '&Ntilde;', '&deg;', '&quot;'), array('á', 'é', 'í', 'ó', 'ú', 'ñ', 'Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ', '°', '"'), $cadena); } /*echo $a; echo "\n"; echo htmlspecialchars_decode($a); */ echo $b; echo "\n"; echo clean($b); echo "\n"; echo decodeTildes($b); echo "\n"; echo decodeTildes(clean($b)); //echo decodeTildes($a);
based on vQ6ZO
Output for 5.3.17 - 7.2.0
CABAÃ?A ""LA CACHIMBA"" DE INES BO CABAALACACHIMBADEINESBO CABAÃ?A ""LA CACHIMBA"" DE INES BO CABAALACACHIMBADEINESBO