For an ASCII question, see the regular expression matching the variable name in the PHP manual:
$pattern = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/';
The naming rules for variable names are as follows:
It must start with a letter, followed by any character in a number, letter, or underline.
However, in the top regular, \ x7f-\ xff cannot be found in the ASCII code table. What exactly does the 129 codes correspond?
Reply to discussion (solution)
The letter is a-z, A-Z, and ASCII characters from 127 to 255 (0x7f-0xff.
The internal code value ranges from 0 to 80 ~ The ASCII code is extended between 0 and FF. because it is occupied by Chinese characters, it is usually invisible.
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 ranges from 0 to 80 ~ The ASCII code is extended between 0 and FF. because it is occupied by Chinese characters, it is usually invisible.
But you can see a part of it.
foreach(get_html_translation_table(HTML_ENTITIES) as $k=>$v) { echo ord($k) . ' => ' . $v . '
';}
Well, after figuring out what these codes are, there is another problem. isn't the naming of variables only allow numbers, letters, and underscores? I just tried to declare a variable.
$a⊥ = '123';echo $a⊥.'
';
There is output. Is this a bit self-explanatory about the limitations?
The letter is a-z, A-Z, and ASCII characters from 127 to 255 (0x7f-0xff.
Oh, now I understand. I don't quite understand it at the beginning.
Thank you!
$ Variable = 'abc ';
Echo $ variable;
Are Chinese characters also letters?
$ Variable = 'abc ';
Echo $ variable;
Are Chinese characters also letters?
Understand! The knowledge is not comprehensive enough. thank you for your attention!