How To Get File Permission In Php Getting Files Permission
how to get file permission in php getting files permission
how, to, get, file, permission, in, php, getting, files, permission
How To Get File Permission In Php Getting Files Permission
Post Description: how to get file permission in php getting files permission
POST# 483
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: 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:

<?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.


Sat Mar 01, 2008 1:44 pm
1
hostman
Reply #1068
you can also use is_writeable() function;

more at:

http://www.php.net/manual/en/function.fileperms.php

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload