How does PHP obtain the Chinese ASCII code?-10544 can be obtained by directly using asc ("Medium") in ASP.
Using ord ('中') in PHP produces 228
How can I obtain Chinese ASCII codes like ASP?
Please help
Reply to discussion (solution)
ASC () ANSI character code
ASC () ANSI character code
Dizzy
Valid only for gbk encoding!
Echo asc ('中'); function asc ($ s) {if (ord ($ s) <128) return ord ($ s ); return current (unpack ('N', "\ xff $ s "));}
-10544
Valid only for gbk encoding!
Echo asc ('中'); function asc ($ s) {if (ord ($ s) <128) return ord ($ s ); return current (unpack ('N', "\ xff $ s "));}
-10544
Thank you very much. I can turn to iconv for UTF-8.
To convert UTF-8 to gbk, it can be consistent with that in asp.
To convert UTF-8 to gbk, it can be consistent with that in asp.
Thank you very much for achieving the goal, but I still don't know the principle. this is too complicated. you need to study it carefully. Otherwise, it will be too disturbing. I will close the post first.