Gets file owner
Syntax
fileowner ( string $filename ) : int
Parameters
filename
Path to the file.
Return
Returns the user ID of the owner of the file, or FALSE on failure. The user ID is returned in numerical format, use posix_getpwuid() to resolve it to a username.
Examples
1
<? $filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/file.txt'; $return = fileowner($filename); print_r($return); ?>
1234567
2
<? $filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/file.txt'; $return = fileowner($filename); $posix_getgrgid = posix_getpwuid($return); print_r($posix_getgrgid); ?>
Array ( [name] => root [passwd] => x [uid] => 1234567 [gid] => 1234567 [gecos] => [dir] => /root [shell] => /bin/bash )