I have an array containing a list of filenames that I want to sort by extension. Folders first then files sorted by extension :
Consider the code below:
$arr = array("noext","world.b","hello.a","test.z","lol.f");
Is there anyway how can I sort the array above depending on the extension to get something like the following :
noext
hello.a
world.b
lol.f
test.z
I know I could use something like usort with a comparing function. But I have no idea how can I do it.
Any help would be highly appreciated.