Ask for an ASCII question

Source: Internet
Author: User
Tags ord
In the PHP manual, you see that the matching variable names are:
$pattern = '/[a-za-z_\x7f-\xff][a-za-z0-9_\x7f-\xff]*/';

The naming conventions for variable names are:
Must begin with a letter followed by any character in a number, letter, or underscore.

But the top of the regular, \x7f-\xff in the ASCII code table can not find Ah, the 129 yards corresponding to what is it?









Reply to discussion (solution)

The letters are a-z,a-z, as well as ASCII characters from 127 to 255 (0X7F-0XFF).

The internal code value between 0x80 ~ 0xFF is the extended ASCII code, because it is occupied by Chinese characters, usually do not see
But you can see a part of it.

foreach (Get_html_translation_table (html_entities) as $k = = $v) {  echo ord ($k). ' = '. $v. '
';}

The internal code value between 0x80 ~ 0xFF is the extended ASCII code, because it is occupied by Chinese characters, usually do not see
But you can see a part of it.

foreach (Get_html_translation_table (html_entities) as $k = = $v) {  echo ord ($k). ' = '. $v. '
';}


Yes, well, figuring out what these codes are. After that, the name of the variable is not a description of only numbers, letters and underscores, I just tried to declare a variable
$a ⊥= ' 123 '; echo $a ⊥. '
';

There is output. Is this a little contradictory to the stated limitations?

The letters are a-z,a-z, as well as ASCII characters from 127 to 255 (0X7F-0XFF).



Oh, this is clear, at first there was a little bit of a misunderstanding.

Thank you very much for two seniors!

$ variable = ' abc ';
echo $ variable;

Aren't Chinese characters also letters?

$ variable = ' abc ';
echo $ variable;

Aren't Chinese characters also letters?


I understand! Knowledge is not comprehensive enough, thanks for mentioning!
  • Related Article

    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.