How to separate directories from files, then sort them?
<p>ilesI am working on a little file manager. I have an associative array of files and directories like this:</p>

<pre><code>$files = array(
    array("name1", "size1", "date1", "type1"),
    array("name2", "size2", "date2", "type2")
);
</code></pre>

<p>Now, what I need to do is sort that array. First I would like to separate directories from folders, as they have a different "type" value in that array. Directories are represented with "dir", files with "file". After I separate those two, I'd like to order them by either name, size, or date (timestamp), ascending or descending.</p>

<p>Can anyone give me an idea how to do this?</p>
