title: Glob array by number value
body: <p>I'm using glob to array my sub directories</p>
  
  <pre><code>&lt;?php
  $items = glob("../albums/*", GLOB_ONLYDIR);
  foreach($items as $item) {
      echo "$item\n ";
  }
  ?&gt;
  </code></pre>
  
  <p>he orders them by the alphabet, i'd like to order them by numbers </p>
  
  <p>if i got sub-directories named 1 , 3 , 5 , 10</p>
  
  <p>the will be arranged like this : 10, 1, 3, 5</p>
  
  <p>i want them to be like this 1, 3, 5, 10</p>
  
  <p>is there an option? thanks</p>
  
  <p><strong>EDIT:</strong>
  now i found natsort($files);
  and when im using it with:</p>
  
  <pre><code>$items = array_slice(glob('albums/*', GLOB_ONLYDIR), 0, 4);
  natsort($items);
  </code></pre>
  
  <p>and my folders are 995-1000
  it gives me this array : 995, 996, 997, 1000</p>