I'm using readdir to loop files into an array and getting back this result:
Array
(
[0] => Array
(
[name] => /css
[type] => directory
[size] => 0
)
[1] => Array
(
[name] => /index.html
[type] => file
[size] => 1208
)
[2] => Array
(
[name] => /js
[type] => directory
[size] => 0
)
)
My goal is to get them in typical 'file structure format' whereas it's ordered first by type (directories then files), then by name alphabetically.