Checking if a File is Writable in PHP


Use is_writable() to check if a file can be written to.

Source Code

if (is_writable('test.txt')) {
    echo "The file is writable.";
} else {
    echo "The file is not writable.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments