SplFileInfo::getOwner

(PHP 5 >= 5.1.2, PHP 7)
Gets the owner of the file
public int SplFileInfo::getOwner ( void )

Gets the file owner. The owner ID is returned in numerical format.

Returns:

The owner id in numerical format.

Exception:

Throws RuntimeException on error.

Examples:
SplFileInfo::getOwner() example
1
2
3
4
<?php
$info new SplFileInfo('file.txt');
print_r(posix_getpwuid($info->getOwner()));
?>
See also:

posix_getpwuid() -

SplFileInfo::getGroup() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.