One, variable
1. Form: $ variable---variable must start with $, followed by the variable name.
2. Delete variable function: unset () is the "referential relationship" between the variable name and the data.
3. There are two ways to transfer values between variables: (the transfer value between variables, must use the reference Pass & symbol)
A. Value passing
is a copy of the value of a variable, assigned to another variable, after copying, two variables are independent of each other
B. Reference delivery
Copy the reference relationship of one variable and assign it to another variable, two variables are associated, point to the same data
4. Variable variable $$ variable
$v 1 = "abc"; This is a string variable whose content is the string "abc"
$ABC = 10; This is an ordinary variable whose content is the number 10
echo $ $v 1; At this point, it's called "mutable variables."
5. Predefined variables (hyper-global variables)
Data type: Hyper-global variables are arrays
A, $_get variable (array): Gets the element and submits the data in Get mode;
b, $_post variable (array): An array of data that is submitted by post.
(Typically, a form form in a Web page is usually post-mode)
C, $_request variable (array): Gets the "sum" of $_post data and $_get data
D, $_server variable (array): Store some request or setup information for server side or client
Second, constant: used to store a data that does not change and does not want to change the identifier.
1, define ("constant name", constant value);
2, const constant NAME = constant value----Const syntax can only be used in the top-most code field (cannot be in curly braces)
3, defined ():
Determine if a constant exists and the result is a Boolean value
$result = defined (a constant name);//The result is true or false
4. Pre-defined constants:
M_pi (PI)
Php_os (operating system)
Php_version (PHP version number)
Php_int_max (the largest integer value in PHP)
5. Magic Variable:
__dir__ (the directory where the current Web page file is located)
__FILE__ (current Web file)
__LINE__ (current line)
PHP Knowledge points-variables and constants