downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ZipArchive::addFromString> <ZipArchive::addEmptyDir
[edit] Last updated: Fri, 23 Mar 2012

view this page in

ZipArchive::addFile

(PHP 5 >= 5.2.0, PECL zip >= 1.1.0)

ZipArchive::addFileYolu belirtilen dosyayı arşive ekler

Açıklama

bool ZipArchive::addFile ( string $dosya [, string $yerel_isim ] )

Yolu belirtilen dosyayı arşive ekler.

Değiştirgeler

dosya

Eklenecek dosyanın yolu.

yerel_isim

Dosyanın ZIP arşivi içindeki ismi.

Dönen Değerler

Başarı durumunda TRUE, başarısızlık durumunda FALSE döner.

Örnekler

Bu örnekte test.zip adında bir ZIP arşivi açılıp /path/to/index.txt dosyası newname.txt ismiyle arşive eklenmektedir.

Örnek 1 - Aç ve ekle

<?php
$zip 
= new ZipArchive;
if (
$zip->open('test.zip') === TRUE) {
    
$zip->addFile('/path/to/index.txt''newname.txt');
    
$zip->close();
    echo 
'Tamam';
} else {
    echo 
'olmadı';
}
?>


add a note add a note User Contributed Notes ZipArchive::addFile
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites