title: Scandir() to show the newest folder
body: <p>I basically have a form that creates a folder when submitted, it takes the last created folder (for example the folder name is 7) and creates a new map based on the last created folder (7+1) thuss making a new folder named 8 etc. etc.</p>
  
  <p>However when I create a map with the name 10 and echo <code>$latest_dir</code> it will still show 9.. whilst it should just show the highest number at all times.</p>
  
  <pre><code>$maindir = scandir("uploads/");
  $latest_dir = $maindir[0];
  $new_dir = $latest_dir+1;
  
  echo $latest_dir;
  </code></pre>
  
  <p>It probably is a stupid question but I'm not really that good with PHP and this is the only thing that is not working so far. Any help is greatly appreciated :)</p>