get_current_user

string get_current_user(void) 

Determines the owner of a PHP script.

Returns:

Owner of script file

Description:

Returns the owner of the file containing the script, not the username of the process executing the script. For instance, while one user may own the script, the name of the user executing the script may be the web server. Depending on the platform that PHP is running on, this can have an effect if attempting to perform such tasks as filesystem access.

get_current_user() can also be used to provide a small measure of system security. By comparing the owner of the script to the owner of a file, Trojan horse–type exploits can be partially minimized. This is useful only on systems with a concept of multiple users and permissions, ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.