Re: readdir(), opendir()
| From: | Pablo E. Siciliano | Date: | Thu, 29 May 2003 20:52:36 +0000 |
| Subject: | Re: readdir(), opendir() | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-36796@lists.php.net to get a copy of this message | ||
De nada.
No será que estas haciendo $files_array = array(); adentro del while?
Otra cosa: Antes de hacer el for, usá sort().
----- Original Message -----
From: "Esteban Fernández" <efernandez@tecsol.cl>
To: <lista@phpes.com>
Sent: Thursday, May 29, 2003 5:33 PM
Subject: Re: [PHP-ES] readdir(), opendir()
>
> <?php
> $handle=opendir('.');
> while ($file = readdir($handle)) {
> $files_array = array();
> if ($file != "." && $file != "..") {
> array_push($files_array, $file);
> }
> }
> closedir($handle);
>
> for ($i=0;$i<=count($files_array);$i++) {
> printf("File: %s<br>", $files_array[$i]);
> }
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 13/05/03