Re: [PHP]Spider script in PHP.

2001-02-10 Thread Hrishi

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 "bru::$from/ubr";
}

}


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]




[PHP]Spider script in PHP.

2001-02-09 Thread Angerer, Chad

I am not sure if this is the correct wording.  But I am wondering about a
good tutorial about writing a PHP script that will spider a directory
structure and extract the file names and insert them into a database.  Also
this spidering would be done on a directory and its child with mp3 files and
I would like to extract the ID3 tag from it.  Any pointers to a good
starting point/reference point would be greatly appreciated.

Thanks.

Chad 

-- 
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]




Re: [PHP]Spider script in PHP.

2001-02-09 Thread Anna

- Original Message -
From: "Angerer, Chad" [EMAIL PROTECTED]


 I am not sure if this is the correct wording.  But I am wondering about a
 good tutorial about writing a PHP script that will spider a directory
 structure and extract the file names and insert them into a database.
Also
 this spidering would be done on a directory and its child with mp3 files
and
 I would like to extract the ID3 tag from it.  Any pointers to a good
 starting point/reference point would be greatly appreciated.

 Thanks.

 Chad


The manual. Use combinations of opendir(), readdir(), is_file(), etc.

Anna


-- 
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]