Created
January 3, 2014 09:30
-
-
Save WenLiangTseng/8235288 to your computer and use it in GitHub Desktop.
Convert Chinese String to UTF8 code.
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 chineseToUnicode( $str ){ | |
$str = rawurlencode( $str ); | |
$str = str_replace("%", "", $str); | |
return $str; | |
} | |
//Print result | |
$str = "旴"; | |
echo chineseToUnicode( $str ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment