illustrate
1. Variable names are strictly case-sensitive, but built-in structures, keywords, and user-customized class names and function names are not case-sensitive.
2. The variable name cannot start with a number, but must start with a letter or underscore, and can be used with any number, letter, or underscore later.
No spaces can be used in the middle, and PHP variable names can also contain Chinese characters.
Example
<?php // Strictly case-sensitive variable names $name = "tarzan"; // Use all lowercase letters to define variables $Name = "skygao"; // Use handwritten uppercase letters to define variables $NAME = "tom"; // Use all lowercase letters Capital letters define variables echo $name; // Output tarzan echo $Name; // Output skygao echo $NAME; // Output tom //Built-in structures and keywords are not strictly case-sensitive echo "this is a test"; //Use all lowercase echo Echo "this is a test"; // Use uppercase Echo ECHO "this is a test"; // Use all caps ECHO phpinfo(); // Call the phpinfo() function using all lowercase letters. Phpinfo(); // Call the Phpinfo() function using all lowercase letters. PhpInfo(); // Call the PhpInfo() function PHPINFO using all lowercase letters. (); // Call the PHPINFO() function using all uppercase letters
The above is the method of naming PHP variables. I hope it will be helpful to everyone.