Home > Backend Development > PHP Problem > What is wrong with PHP variable names?

What is wrong with PHP variable names?

藏色散人
Release: 2023-03-13 22:40:01
Original
3388 people have browsed it

The incorrect PHP variable name is "$9thizBeijing" because PHP variable names must start with letters or underscore characters, and PHP variable names are case-sensitive.

What is wrong with PHP variable names?

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

What is the incorrect PHP variable name?

The incorrect PHP variable name is $9thizBeijing.

What is wrong with PHP variable names?

#This requires familiarity with PHP variable rules.

PHP variable rules are as follows:

  • Variables start with the $ symbol, followed by the name of the variable

  • The variable name must start with Start with a letter or underscore character

  • Variable name can only contain letters, numbers and underscores (A-z, 0-9 and _)

  • Variable name Cannot contain spaces

  • Variable names are case-sensitive ($y and $Y are two different variables)

PHP statements and PHP variables are case-sensitive.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is wrong with PHP variable names?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template