Last active
July 4, 2016 08:21
-
-
Save GeHou/4372486 to your computer and use it in GitHub Desktop.
php:is_utf8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_utf8($str) { | |
$temp_str = @iconv('utf-8', 'utf-8', $str); | |
if ($str === $temp_str) { | |
return 'utf8'; | |
} else { | |
return 'gbk'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment