Dapatkan Chmod of Directory PHP

echo substr(sprintf('%o', fileperms('/path/to/directory')), -4);
// prints something like 1777
Indian Gooner