Php uses recursion to traverse the multi-dimensional array

Source: Internet
Author: User
Array ([dir] & gt; Array ([F: development test test9.14 Chanel 1-10] & gt; Array ([dir] & gt; Array ([F: examples] & gt; Array ([file] & gt; Array ([0] & gt; F: development test test9.14xianaier 1-102362_g_131_59108234.jpg 201205261903496506-php traversal recursion

Array
(
[Dir] => Array
(
[F: \ developer test \ 9.14 Chanel 1-10] => Array
(
[Dir] => Array
(
[F: \ development test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg] => Array
(
[File] => Array
(
[0] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205262133496506-1.jpg
[1] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205262133556506-2.jpg
[2] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205268244003666-3.jpg
[3] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205262134076506-4.jpg
[4] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205261904131096-5.jpg
[5] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205261904196506-6.jpg
[6] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205261_000000006-7.jpg
[7] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205261904116506-8.jpg
[8] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 201205261904116506-9.jpg
[9] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 2362_g_1310859108234.jpg
[10] => F: \ development and testing \ test \ 9.14 Chanel 1-10 \ 2362_g_1310859108234.jpg \ 2362_g_131_59108234.jpg.txt
)

) [F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353134153950.jpg] => Array ([file] => Array ([0] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ large [1] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ large [2] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ large [3] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ large [4] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ large [5] => F: \ development test \ 9.14 Chanel 1-10 \ 2559_g_1353132133950.jpg \ small) [F: \ development test \ 9.14 Chanel 1-10 \ new folder] => Array ([dir] => Array ([F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg] => Array ([file] => Array ([0] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219156516grams crocodile pattern (silver clip-1.jpg [1] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219156516grams crocodile pattern (silver clip-2.jpg [2] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219166516gram crocodile pattern (silver clip-3.jpg [3] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219176516grams crocodile pattern (silver clip-4.jpg [4] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219176516grams crocodile pattern (silver clip-5.jpg [5] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219186516grams crocodile pattern (silver clip-6.jpg [6] => F: \ development test \ 9.14 Chanel 1-10 \ new folder \ 2558_G_1349878776638.jpg \ 201210102219186516grams crocodile pattern (silver clip-7.jpg [7] => F: \ development test \ 9.14 Chanel 1-10 \ create a folder \ 2558_G_1349878776638.jpg \ 2558_G_1349878776638.jpg) [F: \ development test \ 9.14 Chanel 1-10 \ new folder \ shiasd] => Array ())))))

)
Please help me recursively return all the key values of the above array 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.