title: The fastest way to list thousands of folders in local drive in PHP On windows OS?
body: <p>This is the way I list my folder's folders [ only folder ]:</p>
  
  <pre><code>foreach(glob('k:\\thousandoffolders\\*', GLOB_ONLYDIR) as $folders){
      echo basename($folders).' '; // get folder's name
  }
  </code></pre>
  
  <p>So,is it the right way!?</p>
  
  <p>And my purpose is to get <code>all folder's name</code> which inside special folder and store them in the database <code>MySQL</code>.E.g:</p>
  
  <pre><code>drives with special folders:
  
  D:\folderContainer
  E:\folderContainer
  ...
  H:\folderContainer
  </code></pre>
  
  <p>and every <code>folderContainer</code> may be contain <code>thousands of folders</code>.And I just want to go through all the <code>folderContainers</code> and get all folders' name then store inside <code>MySQL</code>.And if folder's name exist in database the <code>MySQL</code> could return it to notice and continue store next one.</p>
  
  <p>Thank you very much!!</p>