首页 > PHP 如何判断一个汉字是不是 UTF-8 编码

PHP 如何判断一个汉字是不是 UTF-8 编码

PHP 如何判断一个汉字是不是 UTF-8 编码


汉字编码后还是汉字么?


mb_detect_encoding


用mb_detect_encoding();

$str = 'áéóú'; // 编码ISO-8859-1
mb_detect_encoding($str, 'UTF-8', true); // 判断结果false
【热门文章】
【热门文章】