Chinese conversion inner code Chinese: Company Limited
The conversion is as follows:
\ Xe6 \ x9c \ x89 \ xe9 \ x99 \ x90 \ xe5 \ x85 \ xac \ xe5 \ x8f \ xb8
Is there any ready-made function in PHP5 for mutual conversion?
Please inform and recommend methods
Thank you.
Reply to discussion (solution)
I have never seen it in the core function library. I assembled it myself:
$ S = 'company limited '; $ ens =' \ X '. implode ('\ X', str_split (bin2hex ($ s), 2); var_dump ($ ens );
String (48) "\ xe6 \ x9c \ x89 \ xe9 \ x99 \ x90 \ xe5 \ x85 \ xac \ xe5 \ x8f \ xb8"
$ S = 'company limited ';
// $ S = iconv ('gbk', 'utf-8', $ s); // you need the internal code of the UTF-8 string, which is required in the gbk environment.
Echo str_replace ('%', '\ X', urlencode ($ s ));
Thank you very much. I am sorry, but I have not logged in for a long time and forgot to close the post.
Thank you, Uncle two.