如何下载压缩文件的子节点之一

I create a Zipped files in PHP like this:

$nameFile = $_FILES['file']['name'];
$tmpName  = $_FILES['file']['tmp_name'];

$fp      = fopen($tmpName, 'r');
$containFile = fread($fp, filesize($tmpName));
fclose($fp);

$zip = new ZipArchive();

$fileconpress = "uploads/".$nameFile.".zip";

$conpress = $zip->open($fileconpress, ZIPARCHIVE::CREATE);
if ($conpress)
{
$zip->addFromString($nameFile, $containFile);
$zip->close();

Everything work's perfectly. In an other page, i'm listing all the zipped files that I have in my folder and all the children in those zipped files (got the list via my database).

I want to be able to download of 1 of the children in the zipped file. How can I open the zipped files on the server and let the user download one of those?

I check on php.net and find zip_read and zip_open but they don't give so much example and I got some difficulty to understand how it really work.

There are a bunch of examples in the php documentation : http://php.net/manual/en/function.zip-open.php

Just open the file, unzip it to a directory and then server the one you want. This setup makes me question if you should just have the unzipped files on your server ready to go but that's you choice.

$zip = new ZipArchive;
$res = $zip->open("uploads/".$parent.".zip");
if ($res === TRUE) {
    $zip->extractTo("uploads/".$parent);
    $zip->close();
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.$child.'');
    header('Pragma: no-cache');
    readfile("uploads/".$parent."/".$child);
} else {
    echo 'failed, code:' . $res;
}