Assignment operators
The basic assignment operator is "=". At first you might think it's "equal", not really. It actually means assigning the value of the right expression to the left operand.
The value of the assignment expression is the value assigned. In other words, the value of "$a = 3" is 3. This allows you to do some tips:
<?php$a = ($b = 4) + 5; $a is now 9, and $b is 4.?>
In addition to the basic assignment operator, there are "combined operators" that are appropriate for all two-tuple arithmetic, array collections, and string operators, so that you can use its value in an expression and assign the result of the expression to it, for example:
<?php$a = 3; $a + = 5; Sets $a to 8, as if we had said: $a = $a + 5; $b = "Hello"; $b. = "there!"; Sets $b to "Hello there!", just like $b = $b. "there!";? >
Note that the assignment operation copies the value of the original variable into a new variable (value assignment), so changing one does not affect the other. This is also suitable for copying some values such as large arrays in a very dense loop. You can also use reference assignment, with $var = & $othervar; Grammar. A reference assignment means that both variables point to the same data, without any copy of the data. For more information on references, see the description of the reference. In PHP 5, objects are always assigned by reference, unless the new clone keyword is explicitly used.
Http://blog.sina.com.cn/s/blog_1603d3c730102wgys.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgys.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgyt.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgyu.html