--------------------------------------------------------------------------------
public errorName ( $p_with_code = false ) |
$archive = new PclZip('archive.zip'); $result = $archive->add('file1.txt', PCLZIP_OPT_REMOVE_PATH, 'path/to/file1/'); if ($result == 0) { echo "Error: " . PclZip::errorName($archive->errorInfo(true)); }
$archive = new PclZip('archive.zip'); $result = $archive->extract(PCLZIP_OPT_PATH, 'path/to/extract/'); if ($result == 0) { echo "Error: " . PclZip::errorName($archive->errorInfo(true)); }In this example, we create an archive object and attempt to extract its contents to a specified path. If the extraction fails, we output the name of the error using the `errorName` function. The PclZip package library is a PHP library for creating and manipulating ZIP archives.
public errorName ( $p_with_code = false ) |