Home > Backend Development > PHP Tutorial > PHP related system functions_PHP tutorial

PHP related system functions_PHP tutorial

WBOY
Release: 2016-07-13 17:46:19
Original
1074 people have browsed it


get_current_user () Gets the name of the owner of the current PHP script

substr(sprintf("%o",fileperms(getcwd())),-4) Get the current file/directory permissions

scandir(getcwd()) Gets all files/directories in the current directory

print_r(posix_getpwuid(10000)); Get user information of a certain uid

chmod("test.txt",0777); Modify the permissions of the specified file or directory

The fileowner() function returns the owner of the file.
php_uname() Get system type and version
getmyuid() Get the UID number of the owner of the PHP script page

print_r (ini_get_all()); Get all configuration options

print_r (php_ini_scanned_files()); Returns the configuration file list in the configuration file directory

$uid = @posix_getpwuid(@posix_geteuid()); Get the current UID information
$gid = @posix_getgrgid(@posix_getegid()); Get the current group GID information
$user = $uid['name']; Extract name
from the user information array $uid = $uid['uid']; Extract uid
from the current user information array $group = $gid['name']; Extract name
from the current group information array $gid = $gid['gid']; Extract gid

from the current group information

Excerpted from: lostwolf's Blog

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478597.htmlTechArticleget_current_user () Get the name of the owner of the current PHP script substr(sprintf(%o,fileperms(getcwd()) )),-4) Get the current file/directory permissions scandir (getcwd()) Get all the current directory...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template