public static function extractZip(string $archive, string $dir, bool $remove = false): void
	{
		$zip = new ZipArchive();
		$x = $zip->open($archive);
		if ($x === true) {
			if (!$zip->extractTo($dir)) {
				throw new IOException("File '$archive' cannot be extracted");
			}
			$zip->close();
			if ($remove) {
				unlink($archive);
			}
		} else {
			throw new IOException("File '$archive' cannot be opened: $x");
		}
	}
public static function extractZip(string $archive, string $dir, bool $remove = false): void
	{
		$zip = new ZipArchive();
		$x = $zip->open($archive);
		if ($x === true) {
			if (!$zip->extractTo($dir)) {
				throw new IOException("File '$archive' cannot be extracted");
			}
			$zip->close();
			if ($remove) {
				unlink($archive);
			}
		} else {
			throw new IOException("File '$archive' cannot be opened: $x");
		}
	}
public static function extractZip ( string $ archive , string $ dir , bool $ remove = false ) : void { $ zip = new ZipArchive ( ) ; $ x = $ zip -> open ( $ archive ) ; if ( $ x === true ) { if ( ! $ zip -> extractTo ( $ dir ) ) { throw new IOException ( "File '$archive' cannot be extracted" ) ; } $ zip -> close ( ) ; if ( $ remove ) { unlink ( $ archive ) ; } } else { throw new IOException ( "File '$archive' cannot be opened: $x" ) ; } }
Rozbaleni adresare ZIP
@param string $archive
@param string $dir
@param bool $remove
@throws IOException
Rozbaleni adresare ZIP