Re: multidimensional arrays
| From: | Joe Stump | Date: | Wed, 18 Apr 2001 01:39:58 +0000 |
| Subject: | Re: multidimensional arrays | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49103@lists.php.net to get a copy of this message | ||
> $a[1][2][3][4][5] = "6";
> echo $a[1][2][3][4][5];
>
> $b[][][][]= "7";
> echo $b[0][0][0][0];
>
> I get '6' and '7'. Am I doing something wrong? This seems like PHP
> supports
> arrays with
> dimensions greater than 2.
You just need to look at PHP's structure. It makes total sense when you think
about it. You can through arrays into cells in an array without any troubles.
I've had arrays go 4 and 5 deep before just because there was an array I needed
to put in a cell that related to that set of data.
It's not wrong and I regard it as a feature.
--Joe
/* Joe Stump
* Sr. PHP Developer
* http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
*/