Because the variables of the controller in Phpcms do not need to assgin the value into the template. All extract () functions become useful! Now let's take a look at his simple usage:
Definition and usage
The extract () function imports variables from an array into the current symbol table.
The function uses the array key name as the variable name , using the array key value as the variable value . For each element in the array, a corresponding variable is created in the current symbol table.
The second parameter type is used to specify how the extract () function treats conflicts when a variable already exists and the element with the same name in the array.
The function returns the number of variables that were successfully imported into the symbol table.
1<?PHP2 $a= "Dog";3 $my _array=Array("A" and "Apple", "b" = "pear", "C" and "banana");4 5 Extract($my _array, Extr_prefix_same, "ANI");6 7 Echo"\ $a =$a; \ $b =$b; \ $c =$c; \ $ani _a =$ani _a";8?>
Output:
$a = dog;
$b = pear;
$c = Banana;
$ani _a = dog;
Php:extract () function