PHP opendir() to list folders only

后端 未结 6 1148
日久生厌
日久生厌 2020-12-14 18:58

I would like to use opendir() to list only the folders in a particular folder (i.e. /www/site/). I would like to exclude files from the list as well at the \'.\' and \'..\'

6条回答
  •  悲&欢浪女
    2020-12-14 19:18

    Try this with glob('*') function

        ' . $value . '
    '; $i++; } ?>

    Above code worked for me for list out folders in current directory and I further developed code to open each folder in a new tab in same browser. This is shows only directories.

提交回复
热议问题