RE: [PHP] Assistance Please - Two-Dimension Arrays

From: Date: Mon, 24 Sep 2001 09:15:16 +0000
Subject: RE: [PHP] Assistance Please - Two-Dimension Arrays
Groups: php.general 
Request: Send a blank email to php-general+get-68494@lists.php.net to get a copy of this message
" Congratulations. You just described a multidimensional array :-) " No he didn't ... a 2 dimensional array would have a set 2 dimensional structure. Each row would have to have the same number of columns. An array of arrays may be built in such a way as to be able to be presented as if it were a 2d array but IT ISN'T. It cannot be manipulated as if it were. $element[0]["id"] and $element[1]["id"] are NOT members of the same array. Tim Ward ---------- From: Christian Reiniger [SMTP:creinig@mayn.de] Sent: 23 September 2001 11:38 To: Jason G.; Mark van Proctor; php-general@lists.php.net Subject: Re: [PHP] Assistance Please - Two-Dimension Arrays On Sunday 23 September 2001 06:54, Jason G. wrote: > Mark, > > PHP, at this point, does not support MultiDimension arrays. However, > you can get around this by placing array's inside arrays. > > Thus: > > $myarray[0] = array("element00", "element01","element02"); > $myarray[1] = array("element10", "element11","element12"); > $myarray[2] = array("element20", "element21","element22"); > > You would refrence "element11" by > $myarray[1][1]; -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR

« previous php.general (#68494) next »