1. Class
The class name is capitalized in the first letter of each word, such as the class name Studentcourse.
2. Constants
The constant name is all uppercase letters, the words are separated by underscores, and the usual names are null, TRUE, FALSE, Root_path, and so on.
3. Variables
In order to ensure the good readability of the code, general requirements in the same software system, the naming principle of variables must be unified.
If the name of the variable can be the first letter lowercase, the rest of the first letter capital (hump);
You can also use the word all letters lowercase, the words are divided by underscores.
4. Arrays
An array is a container in which multiple data elements can be stored, so in an array name, try to use the plural form of the word.
such as $words, $numbers, $colors.
5. Functions
The naming conventions for functions are the same as the naming conventions for variable names. Normally functions perform an action, so when a function is named, a verb is included in the general function.
such as the function name GetName, SetName.
6. database table field
The naming conventions for the database table fields are the same as the naming conventions for the two-name transformation.
7. class files
PHP class files are usually named with a. class.php suffix, and the file name and class name are the same.
such as Student.class.php.
Naming conventions for PHP