I'm building a navigation structure in a series foreach
loops. This navigation currently works successfully, however it does not deal with the '&' character within URL's.
For example I have the following link code:
$nav .= "<li><a href='$url$item->catname/$item->subcatname/$subcat->subcatname'>".$subcat->subcatname ."</a>";
I have tried the following:
$nav .= "<li><a href=" . urlencode('$url$item->catname/$item->subcatname/$subcat->subcatname') . ">".$subcat->subcatname ."</a>";
Although this displays the php markup. What is the best solution here?