<div class="menu clearfix">
<ul>
<li><a href="./">start</a></li>
<li><a href="./?p=rating">rating</a></li>
<li><a href="./?p=upload">upload</a></li>
</ul>
Was a while since i used php. Is there any smart way to do a foreach in php and render this menu + an “active” class to the clicked link. So if the active page is “rating”, the html would render:
<div class="menu clearfix">
<ul>
<li><a href="./">start</a></li>
<li><a href="./?p=rating" class="active">rating</a></li>
<li><a href="./?p=upload">upload</a></li>
</ul>
Thanks
Assuming the
$_GETvalue ofpwould berating(or any other link in the menu for that matter), one could do something like this: