PHP is_writeable () function
Definisi dan Penggunaan
is_writeable () pemeriksaan fungsi apakah file yang diberikan tidak ditulis.
Jika file dapat ditulis, fungsi mengembalikan TRUE.
Fungsi ini adalah fungsi alias is_writable ().
tatabahasa
is_writeable(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件。 |
Tips dan Catatan
Catatan: Hasil fungsi ini cache.Gunakan clearstatcache () untuk menghapus cache.
contoh
<?php
$file = "test.txt";
if(is_writeable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
$file = "test.txt";
if(is_writeable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
Kode di atas akan menampilkan:
test.txt is writeable
Lengkapi manual PHP Filesystem Referensi