Home > PHP > Function > > ZipArchive::addFile()

ZipArchive::addFile()

ZipArchive::addFile - Adds a file to a ZIP archive from the given path

Syntax

bool ZipArchive::addFile (string $filename, string $localname)

Arguments

  • filename - The path to the file to add.
  • localname - local name inside ZIP archive.

Description

Adds a file to a ZIP archive from a given path.

Version

PHP 5.2.0, PECL zip >= 1.1.0

Return value

Returns TRUE on success or FALSE on failure.