<?php
//multidemensional sequential array1
//rectangles
	$rectangle[0][0]=4;
	$rectangle[0][1]=6;
	$rectangle[1][0]=5;
	$rectangle[1][1]=7;
	$rectangle[2][0]=3;
	$rectangle[2][1]=11;

	echo "The area of rectangle index 0 is".($rectangle[0][0]*$rectangle[0][1]);
	echo "<br />";
	echo "The area of rectangle index 1 is".($rectangle[1][0]*$rectangle[1][1]);
	echo "<br />";
	echo "The area of rectangle index 2 is".($rectangle[2][0]*$rectangle[2][1]);
	echo "<br />";
	echo "<br />";

//multidemensional sequential array2
	$colors=array(
		array("red","rgb(255,0,0)"),
		array("yellow","rgb(255,255,0)"),
		array("green","rgb(0,255,0)"),
		array("blue","rgb(0,0,255)")
		);

	echo $colors[0][0];
	echo " - ";
	echo $colors[0][1];
	echo "<br />";
	echo "<br />";

//multidemensional associative array

$phonedirectory=array(
	"John Doe" => array("123 Main","111-222-3333"),
	"Jane Roe" => array("123 Elm","111-222-4444"),
	"Fred Binns" => array("123 Cleveland","111-222-5555")
	);

echo $phonedirectory["John Doe"][0]." - ".$phonedirectory["John Doe"][1];

//use each to iterate
$dummy= asort($phonedirectory);
while(list($person)=each($phonedirectory))
	{
	echo "<br />".$person;
	while (list($persondetails)=each($phonedirectory[$person])) //that comma is important!
		{
		echo " - ".$persondetails;
		}
	}
?>