note 101924 modified in class.dir by danbrown
| From: | danbrown@php.net | Date: | Tue, 18 Jan 2011 17:47:14 +0000 |
| Subject: | note 101924 modified in class.dir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175870@lists.php.net to get a copy of this message | ||
to get a dir of http://www.example.com/directory
<?php
function remotedir($dir)
{
$dir = str_replace(" ", "%20", html_entity_decode($dir));
if (($rh = fopen($dir, 'rb')) === FALSE) { return false; }
$i = 0;
while (!feof($rh)) {
$archivos = fgetss($rh);
$directorio[$i++] = trim( substr($archivos,1,strpos($archivos," ",1)) );
}
fclose($rh);
return $directorio;
}
?>
--was--
to get a dir of http://www.domain.com/directory
function remotedir($dir)
{
$dir = str_replace(" ", "%20", html_entity_decode($dir));
if (($rh = fopen($dir, 'rb')) === FALSE) { return false; }
$i = 0;
while (!feof($rh)) {
$archivos = fgetss($rh);
$directorio[$i++] = trim( substr($archivos,1,strpos($archivos," ",1)) );
}
fclose($rh);
return $directorio;
}
http://php.net/manual/en/class.dir.php