PHP iterates over array multidimensional numbers with recursion

Source: Internet
Author: User
Keywords PHP traversal recursion
PHP traversal recursion

Array
(
[dir]/= Array
(
[f:\ Development Test \test\9.14 chanel 1-10] = = Array
(
[dir]/= Array
(
[f:\ Development Test \test\9.14 chanel 1-10\2362_g_1338059108234.jpg] = = Array
(
[File] = Array
(
[0] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261903496506-1.jpg
[1] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261903556506-2.jpg
[2] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904006506-3.jpg
[3] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904076506-4.jpg
[4] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904136506-5.jpg
[5] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904196506-6.jpg
[6] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904256506-7.jpg
[7] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904316506-8.jpg
[8] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\201205261904386506-9.jpg
[9] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\2362_g_1338059108234.jpg
[Ten] = f:\ development test \test\9.14 Chanel 1-10\2362_g_1338059108234.jpg\2362_g_1338059108234.jpg.txt
)

                            ) [f:\ Development test \test\9.14 chanel 1-10\2559_g_1353138243950.jpg] = = Array                                        ([file] = = Array (                                        [0] = f:\ development test \test\9.14 Chanel 1-10\2559_g_1353138243950.jpg\201211171543306517 blue (crocodile skin) -1.jpg [1] = f:\ development test \test\9.14 Chanel 1-10\2559_g_1353138243950.jpg\201211171543306517 blue (crocodile skin)-2 . jpg [2] = f:\ development test \test\9.14 Chanel 1-10\2559_g_1353138243950.jpg\201211171543306517 Blue (crocodile skin) -3.jpg [3] = f:\ development test \test\9.14 Chanel 1-10\2559_g_1353138243950.jpg\2012111715 43316517 Blue (crocodile skin) -4.jpg [4] = f:\ development test \test\9.14 Chanel 1-10\2559_g_1353138243950.jpg\20 1211171543316517 Blue (crocodile skin) -5.jpg [5] = f:\ development test \test\9.14 Chanel 1-10\2559_g_135313824395 0.jpg\2559_g_1353138243950.jpg) [f:\ development test \test\9.14 Chanel 1-10\                                    New Folder] = = Array ([dir] = = Array                                            ([f:\ dev test \test\9.14 chanel 1-10\ new folder \2558_g_1349878776638.jpg] + = Array                                                    ([File] = Array ([0] = = f:\ Development Test \test\9.1                                                        4 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\201210102219156516 crocodile pattern (Guban) -1.jpg                                                        [1] = = f:\ Development Test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\201210102219156516 crocodile pattern (Guban) -2.jpg [2] = f:\ development test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\2012101022191665       16 g crocodile pattern (Guban) -3.jpg                                                 [3] = f:\ development test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\2012101 02219176516 G crocodile pattern (Guban) -4.jpg [4] = f:\ dev test \test\9.14 chanel 1-10\ new folder \2558_g_1349878776638.jpg\201210102219176516 crocodile pattern (Guban) -5.jpg [5] =&G T                                                        f:\ Development Test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\201210102219186516 crocodile pattern (Guban) -6.jpg                                                         [6] = = f:\ Development Test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\201210102219186516 crocodile pattern (Guban) -7.jpg [7] = f:\ development test \test\9.14 Chanel 1-10\ new folder \2558_g_1349878776638.jpg\                                         2558_g_1349878776638.jpg))                                            [f:\ Development Test \test\9.14 Chanel 1-10\ new folder \shiasd] = = Array       (                                     )                                    )                            ) )            )    )

)
Please help to return all the key values in the above array recursively to a one-dimensional array

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.