ZipArchive::getStreamName

Get a file handler to the entry defined by its name (read only)

&reftitle.description; public ``resource``false```ZipArchive::getStreamName` `string` `name` `int` `flags` 0

Get a file handler to the entry defined by its name. For now, it only supports read operations.

&reftitle.parameters;

`name`

- The name of the entry to use.

`flags`

- If flags is set to `ZipArchive::FL_UNCHANGED`, the original unchanged stream is returned.

&reftitle.returnvalues;

Returns a file pointer (resource) on success&return.falseforfailure;.

&reftitle.examples;

### Get the entry contents with `fread` and store it

    <?php
    $contents = '';
    $z = new ZipArchive();
    if ($z->open('test.zip')) {
        $fp = $z->getStreamName('test', ZipArchive::FL_UNCHANGED);
        if(!$fp) die($z->getStatusString());

        echo stream_get_contents($fp);

        fclose($fp);
    }
    ?>

&reftitle.seealso;

- `ZipArchive::getStreamIndex`