Home / PHP Tips Generated By ChatGPT / 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."; }