ASCII code of Chinese characters question. See a code on the Internet, how to solve

Source: Internet
Author: User
ASCII code of Chinese characters question. A code you see on the Web
PHP Code
  
   
  
   "Echo" ASC: "$ASC;? >


Save with UTF8 save,

Question 1 does not understand haha is UTF8 code?? Why the function can be said to be ASCII to 16 binary. The result is \xe5\x93\x88\xe5\x93\x88.

I checked, haha. The ASCII code of the 16 binary representation is 54c8 54c8, obviously not the same

I don't understand.



------Solution--------------------
It's obviously inappropriate to use "ASCII" here, "turn 16," so that's not appropriate,
The function is actually: the encoding of the string is expressed in the form of 16 binary

So your questions make sense.

Write "non-profit organization or individual, please feel free to reprint, commercial use please with the author's consent" is also very funny,
Because such simple code is not original, others do not need to read and can write the same code,
So, of course, there's no need to "ask for consent."

discuss
PHP Code
/**
*
* ASCII to 16 binary and hex to ASCII
* For non-profit organizations or individuals, please feel free to reprint, commercial use with the consent of the author
*
*/
ASCII to Hex
function Asc2hex ($STR) {
Return ' \x '. substr (Chunk_split (Bin2Hex ($STR), 2, ' \x '), 0,-2);
}
Hex Turn A ...
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.