Home > Backend Development > PHP Tutorial > 请问个ASCII的有关问题

请问个ASCII的有关问题

WBOY
Release: 2016-06-13 12:03:06
Original
945 people have browsed it

请教个ASCII的问题
在PHP手册看到匹配变量名的正则是:

<br /> $pattern = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/';<br />
Copy after login

变量名的命名规则是:
必须已字母开头,后面跟上数字、字母或下划线中的任意字符。

但是最上面的那个正则里,\x7f-\xff在ASCII码表里查不到呀,这129个码对应的又是什么呢?









------解决方案--------------------
字母是 a-z,A-Z,以及从 127 到 255(0x7f-0xff)的 ASCII 字符。
------解决方案--------------------
内码值在 0x80 ~ 0xff 之间的是 扩展ASCII 码,因为被汉字占用了,通常都看不到
不过你可以这要看到一部分
foreach(get_html_translation_table(HTML_ENTITIES) as $k=>$v) {<br />  echo ord($k) . ' => ' . $v . '<br>';<br />}<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template