Home > Backend Development > PHP Tutorial > PHP 不可思议的一个地方

PHP 不可思议的一个地方

WBOY
Release: 2016-06-23 13:48:50
Original
1040 people have browsed it

$arr = array(    '广东' => array(        '广州', '深圳',    ),    '福建' => array(        '福州', '厦门',    ),    '江苏' => array(        '苏州', '上海',    ),    '山东' => array(        '青岛',    ),    '日本' => array(        '札幌',    ),);header('content-type:text/html;charset=utf-8');if (is_array($arr)) {    $i = 0;    $__LIST__ = $arr;    foreach ($__LIST__ as $key => $vo) {        if (is_array($vo)) {            $__LIST__ = $vo;            foreach ($__LIST__ as $key2 => $vo2) {                var_dump($key . " / " . $vo2);            }        }    }}/*string '广东 / 广州' (length=15)string '广东 / 深圳' (length=15)string '福建 / 福州' (length=15)string '福建 / 厦门' (length=15)string '江苏 / 苏州' (length=15)string '江苏 / 上海' (length=15)string '山东 / 青岛' (length=15)string '日本 / 札幌' (length=15) */
Copy after login

在 foreach 里面 $__LIST__ 被重新赋值却再次保留上一层的数据?是PHP 5.5+的新特征?



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