Re: Appending into associative arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/04/07, Zoltán Németh <znemeth@xxxxxxxxxxxxxx> wrote:
2007. 04. 15, vasárnap keltezéssel 21.20-kor Otto Wyss ezt írta:
> I want to sort directories according there modification time and thought
> accociative arrays would be perfect. But when I add an element like
>
> $dirs = array (filemtime($d) => $d)
(sorry the previous one is incorrect, I misunderstood what you
wanted...)
so:
$dirs[filemtime($d)] = $d;

Better, I think, to put the unique thing - the name, as the index.
Two directories may have the same modification time.

$dirs[$d] = filemtime($d);

Alister

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux