Php-related system function _ PHP Tutorial

Source: Internet
Author: User
Php-related system functions. Get_current_user () get the name of the current PHP script owner substr (sprintf (% o, fileperms (getcwd (),-4) get the current file directory permission scandir (getcwd ()) get all get_current_user () in the current directory to get the name of the owner of the current PHP script

Substr (sprintf ("% o", fileperms (getcwd (),-4) get current file/directory permissions

Scandir (getcwd () obtains all files/directories in the current directory.

Print_r (posix_getpwuid (10000); obtain uid user information

Chmod ("test.txt", 0777); modify the permission of a specified file or directory

The fileowner () function returns the object owner.
Php_uname () to obtain the system type and version
Getmyuid () get the UID number of the PHP script page owner

Print_r (ini_get_all (); obtain all configuration options

Print_r (php_ini_scanned_files (); returns the configuration file list under the configuration file directory.

$ Uid = @ posix_getpwuid (@ posix_geteuid (); get UID information
$ Gid = @ posix_getgrgid (@ posix_getegid (); get the GID information of the current group
$ User = $ uid ['name']; extract the name from the user information array
$ Uid = $ uid ['uid']; extracts the uid from the current user information array
$ Group = $ gid ['name']; extract the name from the current group information array
$ Gid = $ gid ['gid']; extract the gid from the current group information

From: lostwolf's Blog

Http://www.bkjia.com/PHPjc/478597.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478597.htmlTechArticleget_current_user () gets the name of the current PHP script owner substr (sprintf (% o, fileperms (getcwd (),-4) get the current file/directory permission scandir (getcwd () to get all...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.