Questions about Ord ()

Source: Internet
Author: User
The problem with Ord ()
The manual says that it is converted to ASCII, but ASCII has only 127 characters. Why does Ord ("I") still be able to output the results?

------Solution--------------------
Who tell U ASCII only 127?

Plus the extension should have 256.

Ord () is the conversion of the first character of a string into an ASCII code. Chinese is a double-byte encoding.
So Ord ("I") is just the ASCII code of the first character of "Me"
------Solution--------------------
$str = ' I ';
$o 1 = ord ($STR);
$o 2 = ord ($str [0]);
Output $o 1=230 $o 2=230
It's clearly written in the manual.
Returns the ASCII code value of the first character of a string.
  • 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.