7th chapter. Variable directory list Web site construction Server script Class \phpphp user manual fancylanguage.variables.html#language.variables.basics> variable variable scope variable base of variables PHP outside
Description of the variable: in PHP is a dollar specifier followed by the name of the variable. Variable names are case-sensitive.
The name of the variable is the same as the other tags in PHP. A valid variable name starts with a word line or underscore, followed by some lines, numbers, or underscores. Regarded as a regular expression, it would be this: [a-za-z_x7f-xff][a-za-z0-9_x7f-xff]*
Note: A letter is a-Z, A-Z, and ASCII characters 127 through 255 (0X7F-0XFF).
$var = "Bob"; $Var = "Joe"; echo "$var, $Var"; Output "Bob, Joe" $4site = not yet; Error The beginning cannot be a number $_4site = not yet; Effective The beginning can be underlined $täyte = Mansikka; Valid: It is ASCII 228.
In PHP 3, variables are assigned by value. In other words, when you assign an expression to a variable, the value of the original expression is copied to the destination variable.
This means that assigning the value of one variable to a different variable will only change the value of those variables without affecting the other variables. See expressions for more information.
PHP 4 provides another way to assign a value to a variable: reference assignment. This means that the new variable is simply referring to the original variable (the new variable is just a "pseudonym" or "point") and changing the new variable will affect the original variable and vice versa. This also means that no replication is performed: Therefore, the allocation is faster. However, such acceleration is only reflected in complex loops or allocations of large arrays and objects.
Assign a reference that simply assigns the variable (source variable) to the "&" number before it is added. For example, the following code snippet outputs my name is Bob two times:
An important hint: only one of the specified variables can be assigned by reference.
http://www.bkjia.com/PHPjc/532351.html www.bkjia.com true http://www.bkjia.com/PHPjc/532351.html techarticle 7th chapter. Variable directory list Web site construction Server script Class \phpphp user manual fancylanguage.variables.html#language.variables.basics> variables of the underlying fixed variable variable scope variable ...