Fri Feb 29, 2008 12:01 pm - how to get file permission in php getting files permission
#1324
how to get file permission in php getting files permission
today i wanted to know how i get a file's permission through php script, well you can do it
you can do this:
OUTPUT
with this, you can verify or show what are the permissions for a certain file in php in your directories from your website.
you can do this:
<?php
echo substr(sprintf('%o', fileperms('/directory')), -4);
echo substr(sprintf('%o', fileperms('/directory/subdirectory')), -4);
?>
echo substr(sprintf('%o', fileperms('/directory')), -4);
echo substr(sprintf('%o', fileperms('/directory/subdirectory')), -4);
?>
OUTPUT
1777
0644
0644
with this, you can verify or show what are the permissions for a certain file in php in your directories from your website.
author: web hosting