PHP fileowner() Function

❮ PHP Filesystem Reference

Example

Return the user ID (owner) of "test.txt":

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

Definition and Usage

The fileowner() function returns the user ID (owner) of the specified file.

Tip: Use posix_getpwuid() to convert the user ID to a user name.

Note: The result of this function is cached. Use clearstatcache() to clear the cache.

Syntax

fileowner(filename)

Parameter Values

Parameter Description
filename Required. Specifies the path to the file to check


Technical Details

Return Value: The user ID of the owner of the file on success, FALSE on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.