Use of function extract in php

巴扎黑
Release: 2023-03-02 18:48:01
Original
1342 people have browsed it

We often encounter extracting the abc index value in the array and paying it to the $abc variable, such as $abc = $_POST['abc'],
This requires such a step. If there are several indexes in $_POST that need to be extracted and paid to the corresponding variables, it will be necessary to write them one by one, which is very troublesome. If you use extract, just

extract($_POST), and then use the variable $abc directly below. The other variables in it are also used in the same way.
Example:

Copy after login

Print result:
Variable a--------Variable b

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!