Home  >  Article  >  Backend Development  >  How to use the is_writable function in php

How to use the is_writable function in php

藏色散人
藏色散人Original
2019-05-24 17:31:262870browse

Usage of the is_writable function in php: [is_writable(file)]. The is_writable function is used to determine whether the file is writable. If the file exists and is writable, the function returns true, otherwise, the function returns false.

How to use the is_writable function in php

php The is_writable function is used to determine whether the file is writable. The syntax of the is_writable function is is_writable(file). The parameter file is required and refers to the file to be checked. .

(Recommended tutorial: php video tutorial)

How to use the php is_writable function?

Function: Determine whether the file is writable

Syntax:

is_writable(file)

Parameters:

file required. Specifies the documents to be checked.

Description:

Returns true if the file exists and is writable. The file parameter can be a directory name that allows writability checking.

php is_writable() function example

<?php
$file = is_writable("./test.txt");
if($file == 1)
{
    echo "该文件是可写的";
}else{
    echo "该文件不可写";
}
?>

The above is the detailed content of How to use the is_writable function in php. For more information, please follow other related articles on the PHP Chinese website!

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