View Full Version : fileowner numerical?

11-19-2009, 01:42 AM
$file_own = fileowner("images/loading.gif");
echo $file_own;

Why does this return 850? What is 850? I'm testing code on an apache and switching it over to windows IIS after. I read somewhere that chmod doesn't work for windows so I thought i could use chown to change the user. Will the owner be a text representation on windows? Thanks.

11-19-2009, 03:42 AM

Return Values

Returns the user ID of the owner of the file, or FALSE in case of an error. The user ID is returned in numerical format, use posix_getpwuid() to resolve it to a username.

I've never used this, though, so that's just what php.net says happens.

11-19-2009, 04:08 AM
Thanks, thats what I need to do and it returned the actual ftp user name.

$file_location = "images/loading.gif";
$file_own = fileowner($file_location);
$it_is = posix_getpwuid($file_own);
echo $it_is[name];

Now to fiddle around with changing the owner.