oh yeah str_replace might help,
well with the count after the first else in my code there is this:
Because if the count is only '1' then the next statement is true so there is more than one..
$toplevel2 = $strip[1];
echo "<li class='sub'><a href='".$_SERVER['PHP_SELF']."?cat=".$catid."'>".$toplevel2."</a>";
$submenu1[] = $toplevel2;
$call[$toplevel] = $toplevel2;
if (isset($strip[2])) <--- and then again here, if there is a third word after '>'
{
$toplevel1 = $strip[2];
echo "--><a href='".$_SERVER['PHP_SELF']."?cat=".$catid."'>".$toplevel1."</a></li>";
$submenu2[] = $toplevel1 ;
$call[$toplevel] = $toplevel1;
}else{
echo "</li>";
}
But if you remember i exploded everything with '>' everything is counted as 1 afer each '>'
I have attached a picture to show what i am trying to achieve a picture can explain this better than writing long pieces of explanation hehe.
thanks for your help... definately cleared a few things up for me.
but if there is a completely different way of writing this then i dont mind doing that, just want a good solution.