<?php
function listDirectory($path){
$where=$path;
$directory=array();
$change=chdir($where);
$handle=opendir('./');
while (($file = readdir($handle))!==false) {
if ((is_dir ($file))and($file!='.')and($file!='..')) {
array_push($directory,$file);
}
}
closedir($handle);
return $directory;
}
function listFile($where,$file_type) {
$found=array();
$handle=opendir($where);
while (($file = readdir($handle))!==false) {
//if (eregi("[a-zA-Z0-p_-]*.$file_type",$file)) {
if (eregi("[a-zA-Z0-p_-]*.$file_type",$file) && ($file!='.') && ($file!='..') ) {
array_push($found,$file);
}
}
closedir($handle);
sort($found);
return $found;
}
?>