open($source)){ for ($i = 0; $i < $zip->numFiles; $i++) { $name = $zip->getNameIndex($i); $path = $name; $count=substr_count($path, '/'); if($count > $level){ continue; } $tree[$name]=$path; } $zip->close(); } } } elseif($source_info['extension']=='tar') { if(class_exists('PharData') && $tar = new PharData($source)) { //TODO: get tar tree } } elseif($source_info['extension']=='rar') { if(class_exists('rar_open') && $rar = new rar_open) { if($res = $rar->open($source)){ $entries = rar_list($res); //TODO: get rar tree $rar->close(); } } } } } } return $tree; } ?>