<?php
$menu = array(
array(
'name' => 'appetizers',
'items' => array( 'chicken wings', 'fried cheese')
),
array(
'name' => 'entrees',
'items' => array( 'hamburger', 'sirloin steak', 'chicken pot pie' )
),
array(
'name' => 'deserts',
'items' => array ( 'cheesecake' )
),
);
$numGroups = count($menu);
?>
<!doctype html>
<html>
<head>
<title>My Restaurant</title>
</head>
<body>
<table>
<tbody>
<?php for($g=0; $g<$numGroups; $g++): ?>
<tr>
<td><?php echo $menu[$g]['name'] ?></td>
<?php $numItems = count($menu[$g]['items']) ?>
<?php for($i=0; $i<$numItems; $i++): ?>
<?php if($i != 0): ?><tr><?php endif ?>
<td><?php echo $menu[$g]['items'][$i] ?></td>
</tr>
<?php endfor ?>
<?php endfor ?>
</tbody>
</table>
</body>
</html>