Home > php教程 > php手册 > body text

php is_writable 函数文件是否可写

WBOY
Release: 2016-06-13 11:17:21
Original
1168 people have browsed it

下面是讲关于is_writable 文件是否可读取写哦。  

下面是讲关于is_writable 文件是否可读取写哦。

is_writable
( PHP 4中, PHP 5中)

is_writable -告诉是否filename是写

描述
布尔is_writable (字符串$文件名)
返回TRUE ,如果文件存在且可写。该文件名参数可能是一个目录名称,让您可以检查,如果是可写的目录。

请记住, PHP的可访问该文件的用户ID的Web服务器运行(通常是'谁' ) 。安全模式的限制是没有考虑到。

参数

文件名
正在检查的文件名。


返回值
返回TRUE ,如果文件存在且可写。

实例

例如# 1 is_writable ( )的例子

$filename = 'test.txt';
if (is_writable($filename)) {
    echo 'The file is writable';
} else {
    echo 'The file is not writable';
}
?>


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!