Home >Backend Development >PHP Tutorial > java软件工程师学php - 8. 神奇的extract()

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

WBOY
WBOYOriginal
2016-06-13 13:11:53731browse

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

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

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

Statement:
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