(PHP 4, PHP 5, PHP 7, PHP 8)
fileowner — Gets file owner
filename
Path to the file.
Returns the user ID of the owner of the file, або false
в разі помилки.
The user ID is returned in numerical format, use
posix_getpwuid() to resolve it to a username.
Під час збоїв буде видаватись E_WARNING
.
Приклад #1 Finding the owner of a file
<?php
$filename = 'index.php';
print_r(posix_getpwuid(fileowner($filename)));
?>
Зауваження: Рузультати цієї функції кешуються. Докладніше: clearstatcache().
Починаючи з PHP 5.0.0, ця функція також може бути використана з деякими URL-обгортками. На сторінці Підтримувані протоколи та обгортки вказано, які обгортки підтримують сімейство функцій stat().