A variable in PHP
Variables in 1.PHP, declaration and use must start with $
2.PHP is a weakly typed language, and variables do not actually need to be declared. You can assign any type of value directly to a variable;
You can declare multiple variables at the same time using a hyphen in 3.PHP.
Eg:num1=num2=num3 and cannot be separated with commas
4. Common variable functions:
unset (): Delete and release variables
Isset (): Detects if the variable is set
Empty (): detects if the variable is empty (not set or null is empty)
5. The name of the variable: only alphanumeric underscores can be made, starting with numbers. And the variables in PHP are case-sensitive, $Name $name are different
However, PHP built-in functions or class names are case-insensitive! Eco Echo is effective!
Data types in 6.PHP (8 kinds)
4 Standard Types: Boolean boolean shaping integer floating-point float/double string
2 composite types: Arrays Array Objects Object
2 Special types: resource resource null
7. The scope of the Shaping: -2^31~ (2^31-1), over this range, automatically to floating-point type.
Two cases of false in PHP
1.Boolean false
2. Shaping 0
3. Float type 0.0
4. String "" "0" ("0.0" "000" are all pairs)
5. Empty array
6. Empty objects are counted as false only in PHP4. Other version objects are counted true
7.null the undefined variable on the monk
8. All resources are right, (except PHP4, all objects are counted)
The variables in PHP and the case in PHP that are counted as false