Ok, basically, I'm making a navigation for my new website layout, but I'm using some rather complicated nested arrays, for lack of being able to think of a better way. I'm hardly a PHP guru :p
Here is what I have for the arrays
$nav = array(
array (
"title" => "general links",
"links" => array("home","home.inc"),
array("boards","/board"),
),
array (
"title" => "tutorials",
"links" => array("serverside","ssi.inc"),
array("html","html.inc"),
array("sample3","sample3.inc"),
)
);
Now, to output this, I used:
foreach ($nav as $category) {
echo "<span class='navtitle'>$category[title]</span>";
foreach ($category as $link) {
echo "<a href='$link[1]'><span>» </span>$link[0]</a>";
}
}
But it keeps giving be an extra link, the first letter of the category...
general links
» g
» home
» boards
tutorials
» t
» serverside
» html
» sample3
What am I doing wrong?