Re: Array Push question

From: Date: Thu, 12 Jul 2007 09:33:00 +0000
Subject: Re: Array Push question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258677@lists.php.net to get a copy of this message
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <johnc@optionsystems.com.au> 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'. > > TIA, > JC > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php Seems my eyes are to tired today. Didn't read the code very good. But the answer still stays the same :) $Rows = array(); array_push($Rows, array('test' => 'this is a test'));

« previous php.general (#258677) next »