- Trending Categories
- 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
fileowner() function in PHP
The fileowner() function returns the user ID of a file. The user ID is returned in numerical format. You need to useposix_getpwuid() to resolve it to a username.
Syntax
fileowner(file_path)
Parameters
file_path − Path of the file.
Return
The fileowner() function returns the user ID on success or FALSE on failure.
Example
<?php $file_path = 'C:/new/one.php'; print_r(posix_getpwuid(fileowner($file_path))); ?>
Note − This function may or may not give correct results on Windows.
Output
0
Above, the output 0 means the file is owner by Root.
Advertisements