Re: Turning a filehandle into an array
| From: | Philip Hallstrom | Date: | Tue, 24 Jul 2001 23:41:23 +0000 |
| Subject: | Re: Turning a filehandle into an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59456@lists.php.net to get a copy of this message | ||
Take a look at the file() function. It does exactly this.
On Tue, 24 Jul 2001, Gonyou, Austin wrote:
> 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
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>