fileowner
PHP function
Edit on GitHub ✎
(PHP 4, PHP 5, PHP 7, PHP 8)
Gets file owner
Description
fileowner(string $filename): int|false
Gets the file owner.
Parameters
filenamePath to the file.
Return Values
Returns the user ID of the owner of the file, Falseforfailure. The user ID is returned in numerical format, use posix_getpwuid() to resolve it to a username.
Errors/Exceptions Failure
Examples
Finding the owner of a file
php
<?php
$filename = 'index.php';
print_r(posix_getpwuid(fileowner($filename)));
?>