downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ZipArchive::unchangeAll> <ZipArchive::statIndex
Last updated: Fri, 13 Nov 2009

view this page in

ZipArchive::statName

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

ZipArchive::statName名前を使用してエントリの詳細を取得する

説明

mixed ZipArchive::statName ( name $name [, int $flags ] )

この関数は、名前を使用してエントリの詳細情報を取得します。

パラメータ

name

エントリの名前。

flags

名前をどのように探すのかを設定します。 また ZIPARCHIVE::FL_UNCHANGED を OR で連結すると、 アーカイブ内に最初に記録された際の情報を取得します。 変更内容は無視されます。

  • ZIPARCHIVE::FL_NOCASE

  • ZIPARCHIVE::FL_NODIR

  • ZIPARCHIVE::FL_UNCHANGED

返り値

エントリの詳細を含む配列、あるいは失敗した場合に FALSE を返します。

例1 エントリの情報の出力

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip');
if (
$res === TRUE) {
    
print_r($zip->statName('foobar/baz'));
    
$zip->close();
} else {
    echo 
'失敗、コード:' $res;
}
?>

上の例の出力は、 たとえば以下のようになります。

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


add a note add a note User Contributed Notes
ZipArchive::statName
martin_packer at uk dot ibm dot com
23-Oct-2009 03:43
This may be stating the obvious but I assume that mtime is "millisecond time". Using http://www.onlineconversion.com/unix_time.htm  the example time "1123164748" converts to "Thu, 04 Aug 2005 14:12:28 GMT".

The two sizes - size and comp_size are presumably in bytes (the latter being the compressed file in the archive).

ZipArchive::unchangeAll> <ZipArchive::statIndex
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites