sorting array
| From: | Adam Smith | Date: | Wed, 12 Dec 2001 12:52:12 +0000 |
| Subject: | sorting array | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-10855@lists.php.net to get a copy of this message | ||
Hi I'm confused with array in php.
$array_eng=array($date => $file)
In this code I read a directory and
use the file date as key and file name as value
but when the loop end i 've only the last file read in the array, it's
like that the array is recreated each time.
Any idea? How arrive to a results like this ( remove // print_r ... ) :
Array ( [20001003] => bms031000_eng.pdf )
Array ( [20001203] => bms031201_eng.pdf )
Array ( [20001107] => bms071101_eng.pdf )
instead of only :
20001107 -> bms071101_eng.pdf
Thanls
$handle=opendir($path_eng);
while (false!==($file = readdir($handle))) {
.
.
.
.
$array_eng=array($date => $file);
// print_r ($array_eng);
}print_r ($array_eng); _________________________________________________________________ Scarica GRATUITAMENTE MSN Explorer dall'indirizzo http://explorer.msn.it/intl.asp.