English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The fileowner() function can return the user ID (owner) of the specified file. This function can return the user ID on success or return false on failure.
int fileowner ( string $filename )
The result of this function can be cached, so we can use the clearstatcache() function to clear the cache. This function cannot run on Windows systems. We can use the posix_getpwuid() function to convert the user ID to a username.
Get the owner of the file:
<?php echo fileowner("sample.txt"); ?>Test and see‹/›
Output Result
0