ZipArchive::renameIndex

(PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL zip >= 1.5.0)

ZipArchive::renameIndex — 인덱스로 정의된 항목의 이름을 바꿉니다.


설명

public ZipArchive::renameIndex(int $index, string $new_name): bool

인덱스로 정의된 항목의 이름을 바꿉니다.


매개변수

index
이름을 바꿀 항목의 인덱스입니다.
new_name
새 이름

반환 값

성공하면 true를, 실패하면 false를 반환합니다.


Examples

예 #1 하나의 항목 이름 바꾸기

                  
<?php
$zip = new ZipArchiave;
$res = $zip->open('test.zip');
if ($res === TRUE) {
    $zip->renameIndex(2,'newname.txt');
    $zip->close();
} else {
    echo 'failed, code:' . $res;
}
?>