### PHP is_writable() 函數
* * * * *
定義和用法
is_writable() 函數判斷指定的文件是否可寫。
#### 語法
is_writable(file)
參數 描述
file 必需。規定要檢查的文件。
#### 說明
如果文件存在并且可寫則返回 true。file 參數可以是一個允許進行是否可寫檢查的目錄名。
#### 提示和注釋
注釋:本函數的結果會被緩存。請使用 clearstatcache() 來清除緩存。
例子
~~~
<?php
$file = "test.txt";
if(is_writable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
~~~
輸出:
test.txt is writeable
- 目錄
- Array
- array_column()
- 數組和變量
- compact() 函數
- extract() 函數
- Url
- base64_encode — 使用 MIME base64 對數據進行編碼
- 圖像
- getimagesize()
- 隨機數
- getrandmax
- mt_getrandmax
- mt_rand
- rand
- empty函數
- exec()函數
- 權限修改
- 可變函數
- 函數閉包
- 報警級別
- 持續函數
- 自定義
- 字符處理
- 中文首字母
- 隨機字符串
- url函數
- parse_url_param
- 頁面采集
- 簡單采集
- Referer采集
- CURL
- 發送json數據
- Curl多線程
- 文件處理
- 遞歸刪除
- 圖片顯示
- 類方法
- 保留字
- 檢查類文件名稱
- Cookie
- 數組
- 數學函數
- 第三方函數庫
- 精度計算
- BC Math
- 計算執行時間
- 日期時間
- 時間戳
- header
- 調試函數
- get_class
- get_class_methods
- 數組函數
- array_intersect_key()
- 二維數組
- Base64編碼
- URL安全
- 加密擴展
- Hash函數
- hash_file
- hash_hmac
- hash_algos
- 文件讀寫
- is_writable()
- file_put_contents()