array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'ziparchive.getarchiveflag.php', 1 => 'ZipArchive::getArchiveFlag', 2 => 'Returns the value of a Zip archive global flag', ), 'up' => array ( 0 => 'class.ziparchive.php', 1 => 'ZipArchive', ), 'prev' => array ( 0 => 'ziparchive.getarchivecomment.php', 1 => 'ZipArchive::getArchiveComment', ), 'next' => array ( 0 => 'ziparchive.getcommentindex.php', 1 => 'ZipArchive::getCommentIndex', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/zip/ziparchive/getarchiveflag.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP >= 8.3.0, PECL zip >= 1.22.0)
ZipArchive::getArchiveFlag — Returns the value of a Zip archive global flag
Returns a Zip archive global flag value.
flag
The global flag to retrieve, among AFL_*
constants:
flags
If flags
is set to ZipArchive::FL_UNCHANGED
,
the original unchanged flag is returned.
Returns 1 if flag is set for archive, 0 if not, and -1 if an error occurred.
Example #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;
}
?>