Skip to content

Instantly share code, notes, and snippets.

@jingmian
jingmian / .php
Created October 19, 2016 08:58
遍历指定目录的文件夹及其子文件夹
<?php
//遍历指定目录的文件夹及其子文件夹
/*
* @param1 string $dir,要遍历的文件夹
* @param2 int $level,当前遍历的文件夹的深度,默认为0,表示第一层
*
* @return array $arr,一个遍历好的数组
*/
function get_dir($dir,$level = 0){