PHP is_writable() 函數
PHP is_writable() 函數

定義和用法
is_writable() 函數檢查指定的文件是否可寫。
如果文件可寫,該函數返回 TRUE。
語法
is_writable(file)
參數 | 描述 |
---|---|
file | 必需。規定要檢查的文件。 |
提示和注釋
注釋:該函數的結果會被緩存。請使用 clearstatcache() 來清除緩存。
實例
<?php
$file = "test.txt";
if(is_writable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
$file = "test.txt";
if(is_writable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
上面的代碼將輸出:
test.txt is writeable

相關文章
- PHP 語法
- PHP $_GET 變量
- PHP 錯誤處理
- PHP 過濾器
- PHP JSON
- PHP array_intersect_assoc() 函數
- PHP array_intersect_uassoc() 函數
- PHP array_key_first() 函數
- PHP array_pad() 函數
- PHP array_replace() 函數
- PHP array_values() 函數
- PHP array_walk() 函數
- PHP current() 函數
- PHP key() 函數
- PHP krsort() 函數
- PHP shuffle() 函數
- PHP uasort() 函數
- PHP 5 Calendar 函數
- PHP HTTP 函數
- PHP 5 MySQLi 函數