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

search for in the

ZipArchive::unchangeAll> <ZipArchive::statIndex
[edit] Last updated: Fri, 17 May 2013

view this page in

ZipArchive::statName

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

ZipArchive::statNameRécupère les détails de l'entrée définie par son nom

Description

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

Cette fonction obtient des informations sur l'entrée définie par son nom.

Liste de paramètres

name

Nom de l'entrée

flags

Le flag spécifie comment la recherche sur le nom doit s'effectuer. ZIPARCHIVE::FL_UNCHANGED doit être utilisé pour récupérer les informations sur le fichier original de l'archive, ignorant toutes les modifications effectuées.

  • ZIPARCHIVE::FL_NOCASE

  • ZIPARCHIVE::FL_NODIR

  • ZIPARCHIVE::FL_UNCHANGED

Valeurs de retour

Retourne un tableau contenant les détails de l'entrée, ou FALSE si une erreur survient.

Exemples

Exemple #1 Récupère les informations d'une entrée

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip');
if (
$res === TRUE) {
    
print_r($zip->statName('foobar/baz'));
    
$zip->close();
} else {
    echo 
'échec, code:' $res;
}
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

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 - [2 notes]
up
1
Stewart Rice
3 years ago
Since a Unix Timestamp is measured in seconds, not milliseconds, I would have to assume that mtime is 'modified time' rather than 'millisecond time'... however it does not appear to work on a Linux system
up
-1
martin_packer at uk dot ibm dot com
3 years ago
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).

 
show source | credits | stats | sitemap | contact | advertising | mirror sites