On Friday 09 February 2001 21:28, Angerer, Chad wrote:

maybe late and all, this pieca code was lying around somewhere in my socks ;) 
see if ya can use it,

hrishi
----begin code snippet--------
<?
function recurse($from,$func="echo")
{
        if(strrchr($from,"/")=="/")
        $from=strrev(substr(strrev($from),1));

        $from=str_replace("//","/",$from);

        chdir("/");
        $fromdir=0;
        $fromdir_class=dir($from);
        $fromdir=$fromdir_class->handle;
        $currpath=$fromdir_class->path;
        chdir($currpath);
        $dirs=array();
        $anchs=array();


        $cnt=0;
        rewinddir($fromdir);
        while($fname=readdir($fromdir))
        {
        if(is_dir($fname))
        {
        $dirs[]=$fname;
        }
        else
        {
        $func($currpath.'/'.$fname);
        }
        }
        closedir($fromdir);

        reset($dirs);

        while($dir=current($dirs))
        {

        if($dir!="." && $dir !="..")
        {
        recurse($currpath . '/' . $dir);
        }
        next($dirs);
//      echo "<br><u>::$from</u><br>";
        }

}


recurse("/home/public_html/");
?>
----end code snippet--------
-- 
--
Yeah, there are more important things in life
than money, but they won't go out with you if
you don't have any.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to