Variable in PHP (for more information, see the php manual ):
To put it bluntly, the variable in php parses the value of a variable into a variable name and reads the value of that variable name. Instance:
<? = "China"; = "a"; = "I'm Chinese !"; = "b"; ."<br />"; $."<br />"; = "f"; $."<br />"; = "b"; $."<br /><br />"; ."<br />"; $."<br />"; $$."<br /><br />"; ."<br />"; $."<br />"; $$."<br />"; $$$."<br /><br />"; = "China"; ."<br />"; $; ?>
Note: Variable variables cannot be applied to $ this and super global variables (the scope of php variables is different from that of other advanced programming languages. View code)
<? = 'man' = 'abc'; $$ = 'def' ."<br />"; ; "<br />
Variable Functions:
<? "This is B" c (= "China") "this is" = 'B' (); = 'C'?>
A typical application of variable variables:
<! DOCTYPE html "-// W3C // dtd xhtml 1.0 Transitional // EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Supplement:
Variable features. If a variable is not declared in advance, if you want to assign a value to a variable, a PHP operation in the background is that when you assign a value to this undeclared variable, the background has already affirmed this variable for you. Let's look at the example:
<? (-> Name )? "True": "false"). "--"-> = A ();-> show ();-> name = "I have output. This variable is declared! "" <Br/> "-> show ();?>
Summary: after reading the above example, you will see the code encapsulated by others. If there is a variable that is not declared, it will be used directly. Don't be surprised. You must set it yourself. You just need to assign values... (PS: In fact, I am also confused at the beginning, because I used to engage in. NET in C #, it is absolutely not allowed to happen. Strong languages are used... Looking at this weak type of language, it is not very suitable at the beginning)