is_writable() 函數(shù)判斷指定的文件是否可寫。
is_writable(file)
參數(shù) | 描述 |
---|---|
file | 必需。規(guī)定要檢查的文件。 |
如果文件存在并且可寫則返回 true。file 參數(shù)可以是一個(gè)允許進(jìn)行是否可寫檢查的目錄名。
注釋:本函數(shù)的結(jié)果會(huì)被緩存。請(qǐng)使用 clearstatcache() 來清除緩存。
<?php $file = "test.txt"; if(is_writable($file)) { echo ("$file is writeable"); } else { echo ("$file is not writeable"); } ?>
輸出:
test.txt is writeable
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答??! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號(hào)