I'm looking for a way to get directory listing for files that are outside the webserver's tree, for example i want to list all files and folders under '/home' directory and put them in an array (just as scandir does).
I can 'sudo su' to a user that has rights to check the directory content but i don't know how to convert a directory listing that i could get from a
exec ('ls -la /home');
Any ideas ? Or maybe with a bash script ?