is_writeable

is_writeable() 函式判斷指定的檔案是否可寫。

該函式是 is_writable() 函式的別名。

基本介紹

  • 外文名:is_writeable
  • 定義:函式判斷指定的檔案是否可寫
  • 語法:file
  • 注釋:本函式的結果會被快取
定義和用法,語法,說明,提示和注釋,例子,

定義和用法

is_writeable() 函式判斷指定的檔案是否可寫。
該函式是 is_writable() 函式的別名。

語法

is_writeable(file)
參數
描述
file
必需。規定要檢查的檔案。

說明

如果檔案存在並且可寫則返回 true。file 參數可以是一個允許進行是否可寫檢查的目錄名。

提示和注釋

注釋:本函式的結果會被快取。請使用 clearstatcache() 來清除快取。

例子

<?php
$file = "test.txt";
if(is_writeable($file)) { echo ("$file is writeable");
} else { echo ("$file is not writeable");
} ?>
輸出:
test.txt is writeable
PHP Filesystem 函式

熱門詞條

聯絡我們