- Forums
- PHP
- How To Get File Permission In Php Getting Files Permission
This Page Contains information about How To Get File Permission In Php Getting Files Permission By wallpaperama in category PHP with 3 Replies. [1114], Last Updated: Sat May 18, 2024
wallpaperama
Sat Mar 01, 2008
3 Comments
4779 Visits
today i wanted to know how i get a file's permission through php script, well you can do it
you can do this:
<?php
echo substr(sprintf('%o', fileperms('/directory')), -4);
echo substr(sprintf('%o', fileperms('/directory/subdirectory')), -4);
?>
OUTPUT
1777
0644
with this, you can verify or show what are the permissions for a certain file in php in your directories from your website.
https://www.wallpaperama.com/forums/how-to-get-file-permission-in-php-getting-files-permission-t5818.html