Get file permissions as an octal value in PHP
Description
The following code shows how to get file permissions as an octal value.
Example
//from ww w . j a v a 2s.c o m
<?php
echo substr(sprintf("%o",fileperms("test.txt")),-4);
?>
The code above generates the following result.