We often encounter the use of the function extract in php. we extract the abc index value from the array and pay it to the $ abc variable. for example, $ abc = $ _ POST ['ABC'], this requires such a step. If several indexes in $ _ POST need to be extracted and paid to the corresponding variables, it is very troublesome to write them one by one. If you use extract, use the extract function in php.
We often encounter that the abc index value in the array is extracted and paid to the $ abc variable, for example, $ abc = $ _ POST ['ABC'],
This requires such a step. If several indexes in $ _ POST need to be extracted and paid to the corresponding variables, it is very troublesome to write them one by one. If you use extract, you only need
Extract ($ _ POST), and then directly use the variable $ abc below. other variables in it are also used in this way.
Instance:
$ _ D ['A'] = 'variable ';
$ _ D ['B'] = 'variable B ';
Extract ($ _ d );
Echo $ a. '-------'. $ B;
?>
Print result:
Variable a -------- variable B
Original address: http://www.python-cn.cn/a/qitayuyan/2011/0517/11459.html 1 floor xieye 2011-05-17 directly with $ _ POST array more convenient 2 floor renzhen 2011-05-17 elements such as $ _ POST using the extract function is not a good way, PHP Manual mentioned
Do not use extract () on untrusted data, like user-input ($ _ GET ,...).
I have seen and used this function in the MVC framework.
In the C layer, assign the variable value to an array through the function assign, and then the framework will extract the array, and the View layer will be able to access the variable passed by the C layer in the form of $ abc. The third floor is yn2010
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service