Re: [PHP] Appending into associative arrays

2007-04-21 Thread Richard Lynch
On Fri, April 20, 2007 5:11 pm, Tijnema ! wrote: > So you end up with a big useless array? How big is the chance that > there are 2 files modified at the same time? 0.1? or is it > 0.01? Well, the OP *said* he had multiple files with the same mtime, and asked why he was only getting on

Re: [PHP] Appending into associative arrays

2007-04-20 Thread Robert Cummings
On Sat, 2007-04-21 at 00:11 +0200, Tijnema ! wrote: > On 4/17/07, Richard Lynch <[EMAIL PROTECTED]> wrote: > > On Sun, April 15, 2007 2:20 pm, Otto Wyss wrote: > > > I want to sort directories according there modification time and > > > thought > > > accociative arrays would be perfect. But when I

Re: [PHP] Appending into associative arrays

2007-04-20 Thread Tijnema !
On 4/17/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Sun, April 15, 2007 2:20 pm, Otto Wyss wrote: > 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) > > the

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Richard Lynch
On Sun, April 15, 2007 2:20 pm, Otto Wyss wrote: > 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) > > the previous ones are lost. I tried array_push but that doe

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Jochem Maas
Zoltán Németh wrote: > 2007. 04. 16, hétfő keltezéssel 10.50-kor Zoltán Németh ezt írta: >> 2007. 04. 16, hétfő keltezéssel 10.40-kor Otto Wyss ezt írta: >>> Zoltán Németh wrote: what do you mean by doesn't work? what error is thrown if any? what result do you get instead of the expected?

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Zoltán Németh
2007. 04. 16, hétfő keltezéssel 10.50-kor Zoltán Németh ezt írta: > 2007. 04. 16, hétfő keltezéssel 10.40-kor Otto Wyss ezt írta: > > Zoltán Németh wrote: > > > what do you mean by doesn't work? what error is thrown if any? what > > > result do you get instead of the expected? > > > at first glance

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Zoltán Németh
2007. 04. 16, hétfő keltezéssel 10.40-kor Otto Wyss ezt írta: > Zoltán Németh wrote: > > what do you mean by doesn't work? what error is thrown if any? what > > result do you get instead of the expected? > > at first glance I cannot see anything wrong with your function... > > > It simply doesn't

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Otto Wyss
Zoltán Németh wrote: what do you mean by doesn't work? what error is thrown if any? what result do you get instead of the expected? at first glance I cannot see anything wrong with your function... It simply doesn't add any sub folder to $dirs. Could it be that the function doesn't return the $

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Zoltán Németh
2007. 04. 16, hétfő keltezéssel 09.27-kor Otto Wyss ezt írta: > Alister Bulman wrote: > > > >>> $dirs[$d] = filemtime($d); > >> Has he even retrieved the directories in sorted order by modification > >> time? If not he still needs to sort. > > > > Then he'll need an asort($dirs); They would not

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Satyam
ginal Message - From: "Otto Wyss" <[EMAIL PROTECTED]> To: Sent: Sunday, April 15, 2007 9:20 PM Subject: [PHP] Appending into associative arrays I want to sort directories according there modification time and thought accociative arrays would be perfect. But when I add an element

Re: [PHP] Appending into associative arrays

2007-04-16 Thread Otto Wyss
Alister Bulman wrote: $dirs[$d] = filemtime($d); Has he even retrieved the directories in sorted order by modification time? If not he still needs to sort. Then he'll need an asort($dirs); They would not have come in any particular order, so you have to sort them for whatever you need anywa

Re: [PHP] Appending into associative arrays

2007-04-15 Thread Alister Bulman
On 15/04/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Sun, 2007-04-15 at 20:36 +0100, Alister Bulman wrote: > On 15/04/07, Zoltán Németh <[EMAIL PROTECTED]> wrote: > > 2007. 04. 15, vasárnap keltezéssel 21.20-kor Otto Wyss ezt írta: > > > I want to sort directories according there modificati

Re: [PHP] Appending into associative arrays

2007-04-15 Thread Robert Cummings
On Sun, 2007-04-15 at 20:36 +0100, Alister Bulman wrote: > On 15/04/07, Zoltán Németh <[EMAIL PROTECTED]> 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 perf

Re: [PHP] Appending into associative arrays

2007-04-15 Thread Alister Bulman
On 15/04/07, Zoltán Németh <[EMAIL PROTECTED]> 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)

Re: [PHP] Appending into associative arrays

2007-04-15 Thread Zoltán Németh
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 misund

Re: [PHP] Appending into associative arrays

2007-04-15 Thread Zoltán Németh
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) why not simply $dirs[] = array (filemtime($d)

[PHP] Appending into associative arrays

2007-04-15 Thread Otto Wyss
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) the previous ones are lost. I tried array_push but that doesn't seems to work, at least I always get syntax errors. N