3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Coss&eacute"; echo utf8_decode("Cossé René"); echo iconv("ASCII","UTF-8//TRANSLIT","Coss&eacute"); $in_utf8encoded = "é à ù è ò Cossé René"; // first you need the convert the string to the charset you want... $in_iso8859encoded = iconv("UTF-8", "ISO-8859-1", $in_utf8encoded); // ...in order to make htmlentities work with the same charset $out_iso8859= htmlentities($in_iso8859encoded, ENT_COMPAT, "ISO-8859-1"); // then only to display in your page, revert it back to utf-8 echo iconv("ISO-8859-1", "UTF-8", $in_iso8859encoded); echo $str = 'Coss&eacute;'; echo utf8_decode($str); echo iconv("ASCII","UTF-8//TRANSLIT",$str); echo $str = iconv('UTF-8', 'ASCII//TRANSLIT', $str); // ASA

preferences:
61.78 ms | 402 KiB | 5 Q