How can is_writable() function be utilized to verify write permissions in PHP file uploads?

When uploading files in PHP, it is important to verify if the destination directory has write permissions to prevent any potential issues. The `is_writable()` function can be utilized to check if a directory is writable before attempting to upload a file. By using this function, you can ensure that the destination directory has the necessary permissions for file uploads.

$uploadDir = 'uploads/';

if (!is_writable($uploadDir)) {
    die('Destination directory is not writable. Please check file permissions.');
}

// Proceed with file upload process