PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ciao! I've searched through PHP documentation but I couldn't find any function that will return the foldercount and the foldernames in a specified folder. I need to get the count of all folders in a folder. Then I need to know the names of those folders, ordered by desceding name order. Is there any function?
glob() can return just directories, and can sort them, however they may not be a human logical sort. You can use natsort() for that. As for getting the number of folders, use count() on the return from glob().
Oh, I made it good, but there's one bug. PHP will return my folder as "../skins/ironlook", it should only return the name of the folder, ironlook. The .php is in different folder than the folders I'm counting. Hmm, any ways to remove the ../skins/ off ?