PHP fileowner() Function

Definition and Usage

The fileowner() function returns the owner of the file.

If successful, returns the user ID of the file owner. If failed, returns false. The user ID is returned in numeric format.

Syntax

fileowner(filename)
Parameter Description
filename Required. Specifies the file to be checked.

Tips and Comments

Tip:The result of this function will be cached. Please use clearstatcache() to clear the cache.

Tip:User ID is returned in numeric format, please use posix_getpwuid() to convert the user ID to a username.

Examples

<?php
echo fileowner("test.txt");
?>