How to change folder permissions in php

王林
Release: 2023-02-28 20:46:01
Original
4415 people have browsed it

How to change folder permissions in php

You can use the chmod() function to achieve this.

Grammar format:

chmod(file,mode)
Copy after login

Parameter introduction:

How to change folder permissions in php

Specific code:

<?php  
// 所有者可读写,其他人没有任何权限
chmod("test.txt",0600);
// 所有者可读写,其他人可读  
chmod("test.txt",0644);
// 所有者有所有权限,其他所有人可读和执行
chmod("test.txt",0755);
// 所有者有所有权限,所有者所在的组可读
chmod("test.txt",0740);  
?>
Copy after login

Please pay attention to more related tutorials php中文网.

The above is the detailed content of How to change folder permissions in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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