What I see most on the Internet is the conversion of Chinese characters to unicode encoding. Today we can see that the opposite operation is to convert unicode to Chinese, next, let's take a look at the most common Chinese character conversion unicode code on the Alibaba Cloud website. Today we can see that the opposite operation is to convert unicode to Chinese. Let's take a look at it.
Script ec (2); script
In the past two days, we helped others develop the platform's friends section to store all user-interests in unicode. After obtaining the content, we need to convert it into Chinese characters.
I checked some methods on the Internet, which is complicated and not particularly useful. Here I recommend a method:
Function unicode_decode ($ name ){
$ Json = '{"str": "'. $ name .'"}';
$ Arr = json_decode ($ json, true );
If (empty ($ arr) return '';
Return $ arr ['str'];
}
Use unicode encoding as a string, save the string in json, and assign a value to the array arr. The output arr value can be converted into Chinese characters.
$ Aihao = unicode_decode ("\ u7f8e \ u98df ");
Echo $ aihao;
Input result: Music
If you want to know Chinese characters converted to Unicode encoding PHP program can refer to the http://www.111cn.net/phper/php-cy/44986.htm