Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

fileowner()

Example

Give me back the owner’s user ID for “test.txt”:

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

Definition and Usage

The user ID (owner) of the given file is returned by the fileowner() function.

Advice: To translate the user ID to a user name, use posix_getpwuid().

 

Note: This function caches its output. To clear the cache, use clearstatcache().

Syntax

fileowner(filename)

Parameter Values

Parameter

Description

filename

Essential. gives the location of the file to be checked.

Technical Details

 

Return Value:

When the file is successful, the owner’s user ID appears; when it doesn’t, FALSE

PHP Version:

4.0+