do not map, print results are written directly in the code, than the stickers clear.
<?php/** * The following 4 lines, the official term, variable variables. * I call it a dynamic assignment variable name. * This can only be played in PHP, because there are $ characters before the variable name in PHP. */$x = "a"; $ $x = "B"; $$ $x = "C"; $$$ $x = "D"; echo $x; The printed result is a echo "<br>"; echo $ $x; The printed result is b echo "<br>"; echo $$ $x; The printed result is C echo "<br>"; echo $$$ $x; The printed result is D-echo "<br>"; echo $x; The printed result is a echo "<br>"; echo $a; The printed result is b echo "<br>"; Echo $b; The printed result is C echo "<br>"; Echo $c; The printed result is D-echo "<br>"; /** cannot print $d because there is no this variable *//** * Below is a variable reference */$m = 10; $n = 20; $y = & $m; Y refers to the value of m, equal to said Y is the alias of M Echo $y; The result of the printing is "<br>"; $m = $n; Echo $y; The result is the echo "<br>"; /** * Variable Reference 1: * If the referenced variable is freed, * the value before the release is preserved */unset ($m); Releases the given variable if (Isset ($y)) {//This variable exists echo "This variable exists";//M is released, but Y saves the value of m before release echo "<br>"; Echo $y; The result is the echo "<br>"; }else{echo "This variable does not exist "; } if (Isset ($m)) {//This variable does not exist in echo "This variable exists"; }else{echo "This variable does not exist";//M is released so there is no echo "<br>"; }/** * Variable reference 2: * Referencing the second variable automatically relieves the reference relationship to the first variable */$p = 66; $q = & $p; Q refers to the value of P, which means that Q is the alias of P Echo $q; The result is the echo "<br>"; $r = 77; $q = & $r; Q refers to the value of R, that is, Q is the alias of R Echo $q; The result is the echo "<br>"; $q = 88; We change the value of Q, see if P, R will change Echo $p; The printing results for 66,p No change, stating that Q and P lifted the reference relationship echo "<br>"; Echo $r; The result of the printing is 88,r into the value of Q, stating that Q and R form a new citation relationship echo "<br>";
The above is the Android programmer to learn PHP development (4)-Variable variable variables reference-phpstorm content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!