function listFolder($folder, $types = 0)
{
$functions = array(
1 => 'is_dir',
2 => 'is_file'
);
$folderList = array();
foreach( glob( "$folder/*" ) as $currentItem )
{
if( $types == 1 or $types == 2 )
{
if( $functions[$types]($currentItem) )
$folderList[] = basename($currentItem);
}
else $folderList[] = basename($currentItem);
}
return $folderList;
}
1 Temmuz 2007 Pazar
Get a List of Folders and/or Files
Subscribe to:
Kayıt Yorumları (Atom)
0 Comments:
Post a Comment