- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
fileperms() function in PHP
The fileperms() function returns the permissions of a file. It returns permission as a number on success, else returns FALSE on failure.
Syntax
fileperms(file_path)
Parameters
file_path − The path of the file to be checked.
Return
The fileperms() function returns permission as a number on success, else returns FALSE on failure.
Example
<?php echo fileperms("new.txt"); ?>
Output
33206
Let us see another example that displays permission as octal value.
Example
<?php echo substr(sprintf('%o', fileperms(two.txt')), -4); ?>
Output
0666
Advertisements