Php is_writable function file writable?

Source: Internet
Author: User
Tags php web server

The following describes whether the is_writable file can be read and written.

The following describes whether the is_writable file can be read and written.

Is_writable
(PHP 4 and PHP 5)

Is_writable-tell whether filename is written

Description
Boolean is_writable (string $ file name)
Returns TRUE if the object exists and can be written. This file name parameter may be a directory name that allows you to check if it is a writable directory.

Remember that the PHP Web server that can access the file's user ID runs (usually 'who '). The limitation of the security mode is not taken into account.

Parameters

File Name
The file name being checked.


Return Value
Returns TRUE if the object exists and can be written.

Instance

Example of #1 is_writable ()

$ Filename = 'test.txt ';
If (is_writable ($ filename )){
Echo 'The file is writable ';
} Else {
Echo 'The file is not writable ';
}
?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.