(PHP 5 >= 5.1.2, PHP 7, PHP 8)
SplFileInfo::isWritable — Tells if the entry is writable
Checks if the current entry is writable.
此函数没有参数。
Returns true
if writable, false
otherwise;
示例 #1 SplFileInfo::isWriteable() example
<?php
$info = new SplFileInfo('locked.jpg');
if (!$info->isWriteable()) {
echo $info->getFilename() . ' is not writeable';
}
?>
以上示例的输出类似于:
locked.jpg is not writeable