psDirList() Dir - list of Dir
Description:
Returns an (array) list of subdir in a directory Key is set to "dir_searched/dir"
Usage:
$aryList = psDirList("/tmp");
Example:
Code:
function psDirList($wDir) { $res = array(); if (file_exists($wDir) == false) { return; } $res = array(); $handle = opendir($wDir); while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { if ( is_dir("$wDir/$entry") == true ) { $res["$wDir/$entry"] = $entry; } } } closedir($handle);
@asort($res); return $res; }
Changlelog:
|