#!/usr/bin/env php open($archive); echo "+ $archive (" . $zip->numFiles . ")\n"; $txt = array(); for ($i = 0; $i < $zip->numFiles; $i++) { $name = $zip->getNameIndex($i); $pos = strpos($name, '/')+1; $txt[] = substr($name, $pos); } sort($txt); file_put_contents( $ver . '/' . basename($archive, "-$ver.zip"), implode("\n", $txt) ); } echo "Done\n";