ZipArchive::setArchiveFlag

(PHP >= 8.3.0, PECL zip >= 1.22.0)

ZipArchive::setArchiveFlagSet a global flag of a ZIP archive

Açıklama

public function ZipArchive::setArchiveFlag(int $flag, int $value): bool

Set a global flag of a ZIP archive.

Bağımsız Değişkenler

flag

The global flag to change, among AFL_* constants.

value
The new value of the flag.

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Örnekler

Örnek 1 Create a torrentzip archive

<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip', ZipArchive::CREATE);
if ($res === TRUE) {
    $zip->setArchiveFlag(ZipArchive::AFL_WANT_TORRENTZIP, 1);
    $zip->addFromString('test.txt', 'file content goes here');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes

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