CakeFest 2024: The Official CakePHP Conference

ZipArchive::deleteName

(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.5.0)

ZipArchive::deleteName名前を使用して、アーカイブからエントリを削除する

説明

public ZipArchive::deleteName(string $name): bool

名前をもとにして、アーカイブ内のエントリを削除します。

パラメータ

name

削除するエントリの名前。

戻り値

成功した場合に true を、失敗した場合に false を返します。

例1 名前を使用した、アーカイブからのファイルやディレクトリの削除

<?php
$zip
= new ZipArchive;
if (
$zip->open('test1.zip') === TRUE) {
$zip->deleteName('testfromfile.php');
$zip->deleteName('testDir/');
$zip->close();
echo
'成功';
} else {
echo
'失敗';
}
?>
add a note

User Contributed Notes

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