hi kishan,
hope this will help you. maybe it needs some editing. good luck!
greetings
function list_files($dirname) {
..$dhandle = opendir($dirname);
....while($file = readdir($dhandle)) {
......if($file != '.' || $file != '..') {
........if(is_dir($dirname.$file)) {
..........list_files($dirname . $file);
........} else {
..........$result[] = $file;
........}
......}
....}
..}
..closedir($dhandle);
..return $result;
}