java软件工程师学php - 8. 神奇的extract()

WBOY
Release: 2016-06-13 13:11:53
Original
718 people have browsed it

java程序员学php - 8. 神奇的extract()
声明这样一个关联数组:
  $map['BJ'] = 'Beijing';
  $map['SH'] = 'Shanghai';

然后做一下extract($map), 你就可以自动获得 $BJ 和 $SH这两个变量,它们的值分别为Beijing和Shanghi。

也就是说,extract替你编程了。这在Java语言里还是很难想象的。

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template