Re: [PHP] Array Push question

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 3:45 am, John Comerford wrote: > Is there a better way of doing the following: > > $Rows[] = array(); > $currentRow = count($Rows) - 1; > $Rows[$currentRow]['test'] = "this is a test"; > > Specifically I am wonder if I can avoid having to use 'count'. count() is not slow, rea

Re: [PHP] Array Push question

2007-07-12 Thread John Comerford
As you guys can probably guess from the question I'm still getting to grips with some parts of php. I had stripped down the code for my original post, maybe this will clear things up a bit: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test"; $Rows

Re: [PHP] Array Push question

2007-07-12 Thread Jim Lucas
John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test"; I imagine that you are doing other actions between the above three lines? Correct? Really, the simplest way of doin

Re: [PHP] Array Push question

2007-07-12 Thread Stut
M. Sokolewicz wrote: Stut wrote: Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test";

Re: [PHP] Array Push question

2007-07-12 Thread M. Sokolewicz
Stut wrote: Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test"; Specifically I am won

Re: [PHP] Array Push question

2007-07-12 Thread Stut
Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test"; Specifically I am wonder if I can

Re: [PHP] Array Push question

2007-07-12 Thread Zoltán Németh
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: > John Comerford wrote: > > Hi Folks, > > > > Is there a better way of doing the following: > > > > $Rows[] = array(); > > $currentRow = count($Rows) - 1; > > $Rows[$currentRow]['test'] = "this is a test"; > > > > Specifically I am won

Re: [PHP] Array Push question

2007-07-12 Thread Thijs Lensselink
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <[EMAIL PROTECTED]> wrote: > Hi Folks, > > Is there a better way of doing the following: > > $Rows[] = array(); > $currentRow = count($Rows) - 1; > $Rows[$currentRow]['test'] = "this is a test"; > > Specifically I am wonder if I can avoid having

Re: [PHP] Array Push question

2007-07-12 Thread Stut
John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = "this is a test"; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 wh

Re: [PHP] Array Push question

2007-07-12 Thread dev
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <[EMAIL PROTECTED]> wrote: > Hi Folks, > > Is there a better way of doing the following: > > $Rows[] = array(); > $currentRow = count($Rows) - 1; > $Rows[$currentRow]['test'] = "this is a test"; > > Specifically I am wonder if I can avoid having