PHP chmod() Fungsi
Referensi Sistem File PHPContoh
Ubah izin untuk file "test.txt":
<?php
// Read and write for owner, nothing for everybody else
chmod("test.txt",0600);
// Read and write for owner, read for everybody else
chmod("test.txt",0644);
// Everything for owner, read and execute for everybody else
chmod("test.txt",0755);
// Everything for owner, read for owner's group
chmod("test.txt",0740);
?>
Definisi dan Penggunaan
Fungsi chmod() mengubah izin file yang ditentukan.
Sintaksis
chmod(file, mode)
Nilai Parameter
Parameter | Description |
---|---|
file | Required. Specifies the path to the file |
mode | Required. Specifies the new permissions. The mode parameter consists of four numbers:
Possible values (to set multiple permissions, add up the following numbers):
|
Detail Teknis
Nilai Kembali: | BENAR pada keberhasilan, SALAH pada kegagalan |
---|---|
Versi PHP: | 4.0+ |
Referensi Sistem File PHP