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

What is wrong with PHP variable names?

藏色散人
藏色散人Original
2021-11-22 09:56:543329browse

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!

Statement:
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