title: PHP set active link on page using includes
body: <p>So I have searched SO for an hour trying to find the answer, and also tried various methods, <a href="http://webdevjunk.com/coding/css/17/php-menu-includes-with-css-style-to-highlight-active-page-link/" rel="noreferrer">including this</a></p>
  
  <p>I am trying to include my pages, along with the navigation. But on the correct page, I need the list-item to have a class of <code>active</code>. The navigation is in header.php and currently looks like this:</p>
  
  <pre><code>&lt;nav&gt;
      &lt;ul&gt;
        &lt;li class="active"&gt; &lt;a href="/"&gt;Home&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; &lt;a href="#"&gt;Apps&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; &lt;a href="#"&gt;Forums&lt;/a&gt; &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  </code></pre>
  
  <p>First, I have no idea if JS(jQuery) would be better, or if PHP was to be better. Both wouldn't matter if it works.</p>
  
  <p>Also I am a bit new with PHP and trying to learn.</p>
  
  <p>What would be the easiest (hopefully) method to use? So I don't have to change a lot of code just to give a nav <code>class="active"</code></p>