title: Allow dots in filenames while searching for extension using pathinfo
body: <p>I want to use <code>pathinfo()</code> to extract the extension from filenames.</p>
  
  <p>As it prints now:</p>
  
  <pre><code>array(4) {
    ["dirname"]=&gt;
    string(33) "E:/folder/some-folder-with.dots"
    ["basename"]=&gt;
    string(13) "some-folder-with.dots"
    ["extension"]=&gt;
    string(10) ".dots"
    ["filename"]=&gt;
    string(2) "some-folder-with"
  }
  </code></pre>
  
  <p>The code I use now:</p>
  
  <pre><code>function rglob($pattern, $flags = 0) {
      $files = glob($pattern, $flags); 
      foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
          $files = array_merge($files, rglob($dir.'/'.basename($pattern), $flags));
      }
      return $files;
  }
  
  $dir = 'E:/folder/*/*.*';
  $files = rglob($dir);
  
  # LOOP
  foreach($files AS $file) {
  
      # KONTROLL
      if($file != '.' AND $file != '..') {
  
          # VARIABEL
          $testing = pathinfo($file);
          $fname = glob($dir.'/*/*.'.$testing['extension']);
  
          echo '&lt;pre&gt;';
          var_dump($testing);
          echo '&lt;/pre&gt;';
  
      }
  
  }
  </code></pre>
  
  <p>The function of this code, is that I want to get every file that are in one folder and then get the extension of every file it finds in order to find the right extension for my website. As it is right now, I can't have dots in my filenames which I want to have.</p>
  
  <p>How can I accomplish this?</p>