[snip]
(ii) All PHP arrays are 1-dimensional.  Some elements of an array may
themselves contain arrays, but that only makes them nested arrays, not
multi-dimensional.  If what you want to know is the deepest level of
nesting, then, no, I don't believe there's a built-in function for this.
[/snip]

>From http://us3.php.net/manual/en/language.types.array.php here is an
example of a multi-dimensional array

<?php
$fruits = array ( "fruits"  => array ( "a" => "orange",
                                       "b" => "banana",
                                       "c" => "apple"
                                     ),
                  "numbers" => array ( 1,
                                       2,
                                       3,
                                       4,
                                       5,
                                       6
                                     ),
                  "holes"   => array (      "first",
                                       5 => "second",
                                            "third"
                                     )
                );

// Some examples to address values in the array above 
echo $fruits["holes"][5];    // prints "second"
echo $fruits["fruits"]["a"]; // prints "orange"
unset($fruits["holes"][0]);  // remove "first"

Or more simply

$arrayFoo[0][0][0]
$arrayFoo[0][0][1]
$arrayFoo[0][1][1]
$arrayFoo[1][1][1]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to