I was just wondering if PHP supports 3d arrays.
I'm using a custom function that takes in a sql statment, and returns the results in a 2D array (eg. $item[0]['name']).
Now I need a bunch of records in the same db to be grouped. Thinking along the lines of having an array setup like :
// item [ group number ] [ record number from the result ] [ attribute]
$item[0][0]['name']
Thanks 🙂
A three dimensional array is essentially an array of arrays.
This would build such a beast:
$array = array("a" => array("b" => array("c" => $x)));
After this, $array['a']['b']['c'] points to $x
can also be done as $array['a']['b']['c'] = $x
Very good 😃
Thanks!