ZipArchive::renameIndex
(PHP 5 >= 5.2.0, PECL zip >= 1.5.0)
ZipArchive::renameIndex — インデックスを使用してエントリ名を変更する
説明
bool ZipArchive::renameIndex
( int $index
, string $newname
)
インデックスを使用して、エントリ名を変更します。
パラメータ
- index
-
名前を変更するエントリのインデックス。
- newname
-
新しい名前。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。
例
例1 エントリ名の変更
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip');
if ($res === TRUE) {
$zip->renameIndex(2,'newname.txt');
$zip->close();
} else {
echo '失敗、コード:' . $res;
}
?>
ZipArchive::renameIndex
There are no user contributed notes for this page.
