💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# PHP is_writeable() 函数 ## 定义和用法 is_writeable() 函数判断指定的文件是否可写。 该函数是 [is_writable()](/php/func_filesystem_is_writable.asp "PHP is_writable() 函数") 函数的别名。 ### 语法 ``` is_writeable(file) ``` | 参数 | 描述 | | --- | --- | | file | 必需。规定要检查的文件。 | ### 说明 如果文件存在并且可写则返回 true。_file_ 参数可以是一个允许进行是否可写检查的目录名。 ## 提示和注释 注释:本函数的结果会被缓存。请使用 [clearstatcache()](/php/func_filesystem_clearstatcache.asp "PHP clearstatcache() 函数") 来清除缓存。 ## 例子 ``` <?php $file = "test.txt"; if(is_writeable($file)) { echo ("$file is writeable"); } else { echo ("$file is not writeable"); } ?> ``` 输出: ``` test.txt is writeable ```