The result will be a very ugly combination of glob() and stat(). Is there some reason you can't work with opendir() and friends?
Edit:
If PHP does not have suitable permissions to access everything you want to see, using another function is not going to help.
What (exactly) are you trying to do?