Home >Backend Development >PHP Tutorial >php is_writable function

php is_writable function

WBOY
WBOYOriginal
2016-07-29 09:15:261532browse

is_writable() definition: The

function determines whether the specified file is writable.

Syntax:

is_writable($filename);

Parameter list:

Parameter Description
filename Required. Specifies the documents to be checked.

Example:

<code><span><span>class</span><span>test</span>{</span><span>public</span><span><span>function</span><span>hello</span><span>(<span>$filename</span>)</span>{</span><span>if</span>(is_writable(<span>$filename</span>)){
             <span>echo</span><span>"$filename is writeable"</span>;
         }<span>else</span>{
             <span>echo</span><span>"$filename is not writeable"</span>; 
         }
     }
 }

<span>$T</span>=<span>new</span> test();
<span>$T</span>->hello(<span>"F:file.txt"</span>);</code>
<code>  输出结果:

   F:<span>file</span>.txt <span>is</span> writeable </code>

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the php is_writable function, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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