Codes attached.
In this page i used filetype instead of is_dir.

<?php
$dir = "jdkcoders/";
function getfiles($dir)
 {
 if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false)
                 {  if($file!='.' && $file!='..')
                                {
                                        if(filetype($dir . $file)=='dir')
                                                {
                                                getfiles($dir."/".$file);
                                                }                                      
 
                                        else
                                                {

                                                echo "<br>$file";                      
                         
                                                
                                                }
                                }
                 }
    closedir($dh);
                 }
        }
  }
getfiles($dir);
?>


Hope you can help me.
Thanks.




John Holmes wrote:

> PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> > Hello Professionals,
> > Can anybody help me to open all subdirectories in a directory,
> > I used is_dir() to check whether it is a dir, and if yes,
> > I recursively called it with the new dir name.
> > But  all subdirectories are not open the recursion is not working for more
> > than 1 level.
> > I tested it in windows server.
> > Expecting your help,

> Expecting your code...

> Have you looked at the opendir manual page to see if there are any 
> examples, there?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to