title: My index.php file is showing all pages on my site at once
body: <p>I am using an index.php file to include the header, navigation and footer on all pages on my site, however I have an issue with my php which is showing all pages within the pages folder at once, rather than just showing the page I'm currently on.</p>
  
  <p>Here is the PHP I am using, any advice would be appreciated!</p>
  
  <pre><code>&lt;?php
  $files = scandir( __DIR__ . '/pages' );
  
  unset( $files[0] );
  unset( $files[1] );
  
  foreach($files as $file){
      include __DIR__ . '/pages/' . $file;
  }
  ?&gt;
  </code></pre>