The fileperms() function returns the permissions of a file. It returns permission as a number on success, else returns FALSE on failure.
Syntax
fileperms(file_path)
Parameters
file_path − The path of the file to be checked.
Return
The fileperms() function returns permission as a number on success, else returns FALSE on failure.
Example
<?php echo fileperms("new.txt"); ?>
Output
33206
Let us see another example that displays permission as octal value.
Example
<?php echo substr(sprintf('%o', fileperms(two.txt')), -4); ?>
Output
0666