How do I check if the charset of a string is UTF8?
mb_detect_encoding($string); will return the actual character set of $string. mb_check_encoding($string, 'UTF-8'); will return TRUE if character set of $string is UTF-8 else FALSE
mb_detect_encoding($string);
$string
mb_check_encoding($string, 'UTF-8');