PhpConcept

Developers Tools

  • Increase font size
  • Default font size
  • Decrease font size
Home PclZip User Guide

PclZip User Guide - PCLZIP_OPT_BY_NAME

Print PDF

PCLZIP_OPT_BY_NAME

This argument allow the extraction of files/folders from the archive by indicating the full filenames of these files.

    $archive = new PclZip('test.zip');
    
$rule_list[0] = 'data/file1.txt';
    
$rule_list[1] = 'data/file2.txt';
    
$list $archive->extract(PCLZIP_OPT_BY_NAME$rule_list);
    if (
$list == 0) {
      echo 
"ERROR : ".$archive->errorInfo(true);
    }
 

The filter can be an array with a filename per row, or a single string with the filenames separated by a comma.

    $archive = new PclZip('test.zip');
    
$list $archive->extract(PCLZIP_OPT_BY_NAME"data/file1.txt,data/file2.txt");
    if (
$list == 0) {
      echo 
"ERROR : ".$archive->errorInfo(true);
    }

See also PCLZIP_OPT_BY_PREG, PCLZIP_OPT_BY_INDEX and PCLZIP_OPT_BY_EREG

 

[Optional Arguments List]

 

Last Updated on Thursday, 17 December 2009 23:29