How can I use the is_writable function to check if a file is writable in PHP? Example code: - Biz Tech

How can I use the is_writable function to check if a file is writable in PHP? Example code:

Listen
$file = "/path/to/file.txt";

if (is_writable($file)) {
    echo "The file is writable";
} else {
    echo "The file is not writable";
}