add active class to menu links using php
<pre><code>&lt;div class="menu clearfix"&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="./"&gt;start&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="./?p=rating"&gt;rating&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="./?p=upload"&gt;upload&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p></p>

<p>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:</p>

<pre><code>    &lt;div class="menu clearfix"&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="./"&gt;start&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="./?p=rating" class="active"&gt;rating&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="./?p=upload"&gt;upload&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p></p>

<p>Thanks</p>
