ccc

Detectar si una cadena está en UTF8

$string= "Castilla y León, 2";
if (mb_detect_encoding($string, 'UTF-8', true) === false) {
echo "FALSE";
}
else {
echo "TRUE";
}
echo "<br>";


$string= "Castilla y León, 2";
if (mb_detect_encoding($string, 'UTF-8', true) === false) {
echo "FALSE";
}
else {
echo "TRUE";
}
echo "<br>";

No hay comentarios:

Publicar un comentario