I want to detect file encoding if it is ANSI or if it is UTF-8 and Unicode. I only find out how to Detect UTF-8
if (mb_detect_encoding(file_get_contents($file), 'UTF-8', true))
{
echo "UTF-8";
}
I want to detect file encoding if it is ANSI or if it is UTF-8 and Unicode. I only find out how to Detect UTF-8
if (mb_detect_encoding(file_get_contents($file), 'UTF-8', true))
{
echo "UTF-8";
}
/* Specify encoding_list character encoding by comma separated list */
echo mb_detect_encoding($str, "ASCII, UTF-8, UNICODE");
it will print the detected encoding with respect to list