RE: [PHP] Assistance Please - Two-Dimension Arrays
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:[EMAIL PROTECTED]] Sent: 23 September 2001 11:38 To: Jason G.; Mark van Proctor; [EMAIL PROTECTED] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Assistance Please - Two-Dimension Arrays
On Monday 24 September 2001 11:15, Tim Ward wrote: 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. If you see it that way, PHP doesn't even have single-dimensional arrays (because all arrays are associative). -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Results 1 - 10 of about 201,000,000. Search took 0.08 seconds - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Assistance Please - Two-Dimension Arrays
fair point, ... but you can manipulate them as if they were. This isn't the case with arrays of arrays and multi-d arrays. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html -Original Message- From: Christian Reiniger [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 24, 2001 11:12 AM To: Tim Ward; [EMAIL PROTECTED] Subject: Re: [PHP] Assistance Please - Two-Dimension Arrays On Monday 24 September 2001 11:15, Tim Ward wrote: 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. If you see it that way, PHP doesn't even have single-dimensional arrays (because all arrays are associative). -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Results 1 - 10 of about 201,000,000. Search took 0.08 seconds - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
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]; Congratulations. You just described a multidimensional array :) -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Assistance Please - Two-Dimension Arrays
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]; Hope it helps! -Jason Garber deltacron.com At 12:03 PM 9/23/2001 +0800, Mark van Proctor wrote: I'm trying to fill information that i read out of files into a 2 dimensional array. My main problem (i think) is that i dont know how to declare a 2 dimensional array prior to adding parts to it. Especially since the size of each internal array and the external array are all picked up from the files and read as strings - i'm not sure how to convert these to ints. I don't know how to test if the data is beign stored in the array because when i come out of the entry loop, the count() size of the array is 0. I'm very new at this so any help you can offer is greatly appreciated. Thanks, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]