note 98337 deleted from function.fileperms by danbrown
| From: | danbrown@php.net | Date: | Wed, 09 Jun 2010 20:04:50 +0000 |
| Subject: | note 98337 deleted from function.fileperms by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169996@lists.php.net to get a copy of this message | ||
Note Submitter: info at dark-cms dot de
----
the right way should be
$path = 'path_to_dir_or_file';
$chmod = fileperms($path);
if($chmod)
{
$chmod = decoct($chmod);
echo substr($chmod, strlen($chmod) - 4);
}
or in one line
echo substr(decoct(fileperms('.')),strlen(decoct(fileperms('.')))-4);