How can I retrieve the full directory tree using SPL?

后端 未结 2 1512
北荒
北荒 2020-11-27 20:26

How can I retrieve the full directory tree using SPL, possibly using RecursiveDirectoryIterator and RecursiveIteratorIterator?

2条回答
  •  萌比男神i
    2020-11-27 21:08

    You can just, or do everythng that you want

    foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $file)
    {
        /* @var $file SplFileInfo */
        //...
    }
    

提交回复
热议问题