Re: Spider script in PHP.

From: Date: Sat, 10 Feb 2001 13:12:43 +0000
Subject: Re: Spider script in PHP.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39078@lists.php.net to get a copy of this message
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.

« previous php.general (#39078) next »