ZipArchive::getArchiveFlag

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

ZipArchive::getArchiveFlagReturns the value of a Zip archive global flag

Descrição

public ZipArchive::getArchiveFlag(int $flag = 0, int $flags = 0): int

Returns a Zip archive global flag value.

Parâmetros

flag

The global flag to retrieve, among AFL_* constants:

flags

If flags is set to ZipArchive::FL_UNCHANGED, the original unchanged flag is returned.

Valor Retornado

Returns 1 if flag is set for archive, 0 if not, and -1 if an error occurred.

Exemplos

Exemplo #1 Test if archive is a torrentzip format

<?php
$zip
= new ZipArchive;
$res = $zip->open('test.zip');
if (
$res === TRUE) {
var_dump($zip->getArchiveFlag(ZipArchive::AFL_IS_TORRENTZIP));
} else {
echo
'failed, code:' . $res;
}
?>

Veja Também

add a note add a note

User Contributed Notes

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