Yes you can. You can even "nest" the arrays, that is make an array of arrays...
$titles = array(
'main1' => array('sub11', 'sub12', 'sub13'),
'main2' => array('sub21', 'sub22', 'sub23')
);
foreach ($titles as $mainitem=>$sub) {
echo $mainitem . '<br />';
foreach ($sub as $subitem) {
echo $subitem . '<br />';
}
echo '<br />';
}
btw this works too and you dont have to drop in and out of php mode quite so often:
<?php
echo '<a href="' . $temp '.php">';
?>