Home > Backend Development > PHP Tutorial > PHP初记(2) - extract()方法

PHP初记(2) - extract()方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:03:06
Original
954 people have browsed it

PHP小记(2) - extract()方法

定义和用法

PHP extract() 函数从数组中把变量导入到当前的符号表中。

对于数组中的每个元素,键名用于变量名,键值用于变量值。

第二个参数 type 用于指定当某个变量已经存在,而数组中又有同名元素时,extract() 函数如何对待这样的冲突。

本函数返回成功设置的变量数目。


一般用途:

extract($_REQUEST)

extract($_GET)

extract($_POST)

?

这样可以把提交上来的参数直接转换为$变量名和变量值

Related labels:
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 Issues
Method to extract words: use regular expressions
From 1970-01-01 08:00:00
0
0
0
Python extract domain name from URL
From 1970-01-01 08:00:00
0
0
0
Extract array from database
From 1970-01-01 08:00:00
0
0
0
Can mysql extract two fields to combine?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template