Forum und email

ZipArchive::renameIndex

(No version information available, might be only in CVS)

ZipArchive::renameIndex — インデックスを使用してエントリ名を変更する

説明

bool ZipArchive::renameIndex ( int $index , string $newname )

インデックスを使用して、エントリ名を変更します。

パラメータ

index

名前を変更するエントリのインデックス。

newname

新しい名前。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

Example#1 エントリ名の変更

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip')
if (
$res === TRUE) {
    
$zip->renameIndex(2,'newname.txt');
    
$zip->close();
} else {
    echo 
'失敗、コード:' $res;
}
?>