An array can be of any dimension length. So your declaration var name = new array(); will work for it. But when you fill the array is when you need to think about how many dimensions it's going to have.
Examples of filling arrays;
$name = array("bob", "frank", "bill");
$name = array("first" => array("bob", "frank", "bill"),
"last" => array("smith", "jones", "doe"));
$name = array(1 => array("first" => array("bob", "frank", "bill"),
"last" => array("smith", "jones", "doe")),
2 => array("first" => array("mary", "jane"),
"last" => array("smith", "jones")));
There are 3 different array declarations all using the same style to declare them. You could also do something like this:
$name = array();
$name["last"] = array("bob", "frank", "bill");
$name[1]["last"] = array("bob", "frank", "bill");
And so on.