PHP 8.3.4 Released!

ZipArchive::renameName

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

ZipArchive::renameNameİsmi belirtilen girdinin ismini değiştirir

Açıklama

public ZipArchive::renameName(string $isim, string $yenisi): bool

İsmi belirtilen girdinin ismini değiştirir.

Bağımsız Değişkenler

isim

Girdinin değiştirilecek ismi.

yenisi

Girdinin yeni ismi.

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Örnekler

Örnek 1 - Bir girdinin ismini değiştirmek

<?php
$zip
= new ZipArchive;
$res = $zip->open('test.zip');
if (
$res === TRUE) {
$zip->renameName('currentname.txt','newname.txt');
$zip->close();
} else {
echo
'Olmadı, kod:' . $res;
}
?>
add a note

User Contributed Notes 1 note

up
2
mumpitz89 at gmx dot net
8 years ago
When you rename a file in an archive using the function above and the target file name already exists, the function will return FALSE as a result.
To Top