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.