Phpchmod function tutorial _ PHP Tutorial

Source: Internet
Author: User
Phpchmod function tutorial. Phpchmod defines and uses the chmod attribute () function to change the permissions of a specified file. if TRUE or FALSE is returned, the operation fails. Phpchmod definition and usage chmod attribute () function changes php chmod definition and usage chmod attribute () function changes the permission of the specified file, if the return of TRUE or FALSE fails.

Php chmod definition and usage
The chmod attribute () function changes the permission of the specified file. if TRUE or FALSE is returned, the operation fails.

Syntax

chmod(file,mode)

file
Required. Specified file check
Mode

Required. Specify new permissions. The parameter mode consists of four numbers: first, the number of permissions is always zero. Second, the number of permissions specified by the owner. third, the number of user groups specified by the permission owner. fourth, the number of permissions specified by the permission owner. others can be assigned (set multiple permissions and add the following number):

1 = execution permission

2 = write permission

4 = read permission

Let's take a look at the instance.
 // Read and write for owner, who reads and writes nothing for, is not the owner of other chmod ("test.txt", 0600); // Read and write for Read/write, Read by others
Chmod ("test.txt", 0644); // Everything for all Masters, read and execute others
Chmod ("test.txt", 0755); // Everything for everyone, read the owner's group
chmod("test.txt",0740);?> 

The http://www.bkjia.com/PHPjc/445507.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445507.htmlTechArticlephp chmod defines and uses the chmod attribute () function to change the permissions of the specified file if success fails when TRUE and FALSE are returned. Changes to the chmod attribute () function in php definition and usage...

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.