array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'context.zip.php', 1 => 'Zip コンテキストオプション', ), 'up' => array ( 0 => 'context.php', 1 => 'コンテキストオプションとパラメータ', ), 'prev' => array ( 0 => 'context.params.php', 1 => 'コンテキストパラメータ', ), 'next' => array ( 0 => 'context.zlib.php', 1 => 'Zlib コンテキストオプション', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'language/context/zip.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
Zip コンテキストオプション — Zip コンテキストオプション一覧
Zip コンテキストオプションは zip
ラッパーで使用可能です。
バージョン | 説明 |
---|---|
PHP 7.2.0, PECL zip 1.14.0 |
password が追加されました。
|
例1 password
の基本的な使用例
<?php
// 暗号化されたアーカイブを参照する
$opts = array(
'zip' => array(
'password' => 'secret',
),
);
// コンテキストを作成して
$context = stream_context_create($opts);
// データを取得する
echo file_get_contents('zip://test.zip#test.txt', false, $context);
?>