Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Context parametersZlib context options>
^Context options and parametersLast updated: Mon, 26 Oct 2026

Zip context options

Zip context options — Zip context option listing

Description

Zip context options are available for zip wrappers.

Options

password

Used to specify password used for encrypted archive.

Changelog

Version Description
7.2.0, PECL zip 1.14.0 Added password.

Examples

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);

?>


<Context parametersZlib context options>
^Context options and parametersLast updated: Mon, 26 Oct 2026