[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="author" content="Robert Deiman" />
	<meta http-equiv="charset" content="iso-8859-1" />
	<meta http-equiv="content-language" content="nl-en" />
	<meta name="title" content="mutidymensionaal menu" />
	<title>Multidymensionaal menu</title>
	<style>
	a:link.active{
		color:#00ccbb;	
		text-decoration:none;	
		}
	a:visited.active{
		color:#00ccbb;	
		text-decoration:none;	
		}
	a:hover.active{
		color:#00ccbb;	
		text-decoration:underline;	
		}
	a:active.active{
		color:#00ccbb;	
		text-decoration:none;	
		}
	a:link{
		color:#000000;	
		text-decoration:none;	
		}
	a:visited{
		color:#000000;	
		text-decoration:none;	
		}
	a:hover{
		color:#000000;	
		text-decoration:underline;	
		}
	a:active{
		color:#000000;	
		text-decoration:none;	
		}
		
/*	a:link {color: #FF0000}  
a:visited {color: #00FF00}
a:hover {color: #FF00FF} 
a:active {color: #0000FF}
*/
	</style>
</head>
<body>
<?php

error_reporting(E_ALL);
ini_set('error_reporting',1);
/**
 * @author Robert Deiman
 * @copyright 2008
 * @param $array_items Array Contains a multidymensional array with the items for the menu
 */

function generate_menu($array_items)
	{
		if(!isset($return_string)){
			$return_string = '<ul>'."\n";
			}
		foreach($array_items AS $key => $value)
		{
   			if(!is_array($value))
			{
				if($value == $_GET['pag'])
				{
					$actief = ' class="active"';
				}
				else
				{
					$actief = '';
				}
			   	$return_string .= '<li><a href="?pag='.$value.'"'.$actief.'>'.$value.'</a></li>'."\n";
			}   
   			else
			{
				if($key == $_GET['pag'])
				{
					$actief = ' class="active"';

				}
				else
				{
					$actief = '';
				}
				
				//print_r($value);
   				$return_string .= '<li><a href="?pag='.$key.'"'.$actief.'>'.$key.'</a>'."\n";
				$return_string .= generate_menu($value);
				$return_string .= '</li>';
			}
   		}
   		$return_string.= '</ul>'."\n";
   		return $return_string;
	}
      
$menu = array('home','nieuws'=>array('archief','laatste','recent'=>array('vandaag','gisteren')),'contact');


echo generate_menu($menu);
?>
</body>
</html>
[/code]