Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SplFileInfo::isReadableSplFileInfo::openFile>
^SplFileInfoLast updated: Mon, 26 Oct 2026

SplFileInfo::isWritable

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::isWritable — Tells if the entry is writable

Description

public function SplFileInfo::isWritable(): bool

Checks if the current entry is writable.

Parameters

This function has no parameters.

Return Values

Returns true if writable, false otherwise;

Examples

Example #1 SplFileInfo::isWritable() example

<?php
$info = new SplFileInfo('locked.jpg');
if (!$info->isWritable()) {
    echo $info->getFilename() . ' is not writable';
}
?>

The above example will output something similar to:

locked.jpg is not writable


<SplFileInfo::isReadableSplFileInfo::openFile>
^SplFileInfoLast updated: Mon, 26 Oct 2026