PHP8 ZipArchive::statIndex

2024-02-27 11:09 更新

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

ZipArchive::statIndex — 获取由其索引定义的条目的详细信息

说明

public ZipArchive::statIndex(int $index, int $flags = 0): array|false

该函数获取有关其定义的条目的信息 指数。

参数 

index

条目的索引

flags

ZipArchive::FL_UNCHANGED 可以 OR 到它请求 有关存档中原始文件的信息, 忽略所做的任何更改。

返回值 

返回一个包含条目详细信息的数组,或者在失败时返回 false。

示例 

示例 #1 转储条目的统计信息

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

以上示例的输出类似于:

Array
(
    [name] => foobar/baz
    [index] => 3
    [crc] => 499465816
    [size] => 27
    [mtime] => 1123164748
    [comp_size] => 24
    [comp_method] => 8
)


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号