时间:2021-07-01 10:21:17 帮助过:16人阅读
function get_dir( $a, $s = 0, $d = array( '.', '..' ), $f = array() ) { foreach ( scandir( $a ) as $g ) { if ( !in_array( $g, $d ) ) { $g = $a . '/' . $g; if ( $s > 0 && is_dir( $g ) ) { ( $s == 1 || $s > 3 || ( $s == 2 && count( scandir( $g ) ) == 2 ) ) && $f[] = $g . '/'; $s > 1 && $s < 6 && $f = get_dir( $g, $s, $d, $f ); } else { ( ( $s && $s < 5 ) || ( !$s && is_file( $g ) ) ) && $f[] = $g; }; }; }; return $f; }
1 楼 bupt_roy 2011-09-26
向大牛学习