Home > Backend Development > PHP Tutorial > php 用递归遍历数组多维数

php 用递归遍历数组多维数

WBOY
Release: 2016-06-02 11:29:25
Original
929 people have browsed it

php遍历递归

Array
(
[dir] => Array
(
[F:\开发测试\test\9.14香奈儿1-10] => Array
(
[dir] => Array
(
[F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg] => Array
(
[file] => Array
(
[0] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261903496506-1.jpg
[1] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261903556506-2.jpg
[2] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904006506-3.jpg
[3] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904076506-4.jpg
[4] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904136506-5.jpg
[5] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904196506-6.jpg
[6] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904256506-7.jpg
[7] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904316506-8.jpg
[8] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\201205261904386506-9.jpg
[9] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\2362_G_1338059108234.jpg
[10] => F:\开发测试\test\9.14香奈儿1-10\2362_G_1338059108234.jpg\2362_G_1338059108234.jpg.txt
)

<code>                            )                        [F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg] => Array                            (                                [file] => Array                                    (                                        [0] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\201211171543306517兰(鳄鱼皮)-1.jpg                                        [1] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\201211171543306517兰(鳄鱼皮)-2.jpg                                        [2] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\201211171543306517兰(鳄鱼皮)-3.jpg                                        [3] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\201211171543316517兰(鳄鱼皮)-4.jpg                                        [4] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\201211171543316517兰(鳄鱼皮)-5.jpg                                        [5] => F:\开发测试\test\9.14香奈儿1-10\2559_G_1353138243950.jpg\2559_G_1353138243950.jpg                                    )                            )                        [F:\开发测试\test\9.14香奈儿1-10\新建文件夹] => Array                            (                                [dir] => Array                                    (                                        [F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg] => Array                                            (                                                [file] => Array                                                    (                                                        [0] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219156516克鳄鱼纹(古银扣)-1.jpg                                                        [1] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219156516克鳄鱼纹(古银扣)-2.jpg                                                        [2] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219166516克鳄鱼纹(古银扣)-3.jpg                                                        [3] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219176516克鳄鱼纹(古银扣)-4.jpg                                                        [4] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219176516克鳄鱼纹(古银扣)-5.jpg                                                        [5] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219186516克鳄鱼纹(古银扣)-6.jpg                                                        [6] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\201210102219186516克鳄鱼纹(古银扣)-7.jpg                                                        [7] => F:\开发测试\test\9.14香奈儿1-10\新建文件夹\2558_G_1349878776638.jpg\2558_G_1349878776638.jpg                                                    )                                            )                                        [F:\开发测试\test\9.14香奈儿1-10\新建文件夹\shiasd] => Array                                            (                                            )                                    )                            )                    )            )    )</code>
Copy after login

)
求帮忙 把上面的数组用递归返回所有的键值到一个一维数组中

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