-
-
Save firejune/30a906a349b16cec5408e99b9666b5b7 to your computer and use it in GitHub Desktop.
php:is_utf8
This file contains 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