Display The File Permission - Php

How to display file permission in php?

Snippet Code


  
Rate this page :
  [ 0 votes]

The script displays information related to particular file through php code. In chkfile() function give the file name to view permission of that file. fileperms() method is used to get the permission of the file.

<?php function chkfile($filepath) { clearstatcache(null, $filepath); return decoct( fileperms($filepath) &0777 ); } echo chkfile("test.txt"); ?>

Tags


Ask Questions

Ask Question