Turning a filehandle into an array
| From: | Gonyou, Austin | Date: | Tue, 24 Jul 2001 20:17:35 +0000 |
| Subject: | Turning a filehandle into an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59426@lists.php.net to get a copy of this message | ||
What is the best way to turn a filehandle into an array?
This is the code I've got now, but I don't like it because it's rather in
efficient for my purposes. I can format this to be much prettier, but I'm
not too concerned about it right now. I'd just like to get the filehandles
to work.
------snip------
<?
if ($dr == null)
$dir=opendir("./");
else
$dir=opendir("$dr");
exec("ls $dir", $ls);
print "<pre>\n";
for($i=0;$i<sizeof($ls);$i++) {
print $ls[$i]."\n";
}
print "</pre>\n";
?>
------snip------
--
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: austin@coremetrics.com