Home > Backend Development > PHP Tutorial > Chinese variable description in PHP_PHP tutorial

Chinese variable description in PHP_PHP tutorial

WBOY
Release: 2016-07-21 15:26:42
Original
1027 people have browsed it

A valid variable name in PHP starts with a letter or an underscore, followed by any number of letters, numbers, or underscores. According to normal regular expressions, it will be expressed as: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'.

Note: The letters mentioned here are a-z, A-Z, and ASCII characters from 127 to 255 (0x7f-0xff).

Copy code The code is as follows:

$var = 'Bob';
$ Var = 'Joe';
echo "$var, $Var"; // Output "Bob, Joe"

$4site = 'not yet'; // Illegal name change; starts with a number
$_4site = 'not yet'; // Legal variable name; starts with underscore
$i site is = 'mansikka'; // Legal variable name; can be in Chinese
?>



Someone just gave me a php file. When I opened it, I was shocked. Could it be that the legendary Chinese programming is so easily implemented in PHP?

I just looked through the Chinese PHP manual and there are indeed examples of Chinese variables

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323912.htmlTechArticleA valid variable name in PHP starts with a letter or an underscore, followed by any number of letters, numbers, or Underline. According to normal regular expressions, it will be expressed as: ...
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