PHP 8.1.31 Released!

Zip context options

Zip context optionsZip context option listing

Descrizione

Zip context options are available for zip wrappers.

Opzioni

password

Used to specify password used for encrypted archive.

Log delle modifiche

Versione Descrizione
7.2.0, PECL zip 1.14.0 Added password.

Esempi

Example #1 Basic password usage example

<?php
// Read encrypted archive
$opts = array(
'zip' => array(
'password' => 'secret',
),
);
// create the context...
$context = stream_context_create($opts);

// ...and use it to fetch the data
echo file_get_contents('zip://test.zip#test.txt', false, $context);

?>

add a note

User Contributed Notes

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