PHP 8.4.24 Released!

SplFileInfo::isWritable

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

SplFileInfo::isWritableTells if the entry is writable

Опис

public function SplFileInfo::isWritable(): bool

Checks if the current entry is writable.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns true if writable, false otherwise;

Приклади

Приклад #1 SplFileInfo::isWritable() example

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

Поданий вище приклад виведе щось схоже на:

locked.jpg is not writable

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top