PHP variables. In PHP, the variable program in PHP is composed of two parts: code and data. data is stored in the variable. the essence of the variable is a storage space in the memory. Empty PHP variable corresponding to the variable, PHP variable
Variables in PHP
A program is composed of two parts: code and data. data is stored in variables. the essence of a variable is a storage space in memory. The space corresponding to the variable has a sub-name called the variable name, which is used to read and write data.
Variable definition
The '$' symbol must be used before the php variable name, or '$' is the syntax structure that defines the variable.
Example:
Variable access
Echo variable name;
Example:
Variable modification
Variable name = value;
Deletion of variables
Unset (variable name );
Example:
Variable naming rules:
1. it must start with '$'
2. only letters, numbers, and underscores are allowed.
3. the '$' symbol cannot start with a number.
Variable programs in PHP are composed of two parts: code and data. data is stored in variables. the essence of variables is a storage space in memory. Variable corresponding to null...