Zip 脈絡選項 — Zip 脈絡選項列表
Zip 脈絡選項可用於 zip
包裝器。
版本 | 說明 |
---|---|
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);
?>