Work with ZIP-archives in PHP 5.2+

Starting with PHP 5.2 you can use useful library ZipArchive for easy working with ZIP archives.
(If your PHP version les 5.2 you’ll get error: class ziparchive not found)

Steps for easy working with ZipArchive

$zip = new ZipArchive;

Read ZIP archive:


Create new ZIP archive (just add ZipArchive::CREATE):

$zip->open('{file_location_path}', ZipArchive::CREATE);

Example of extracting archive on your server:

$zip = new ZipArchive;
if ($zip->open('{file_location_path}') === true){
	echo 'Archive file is not found';

Example of creating archive on your server:
Continue reading Work with ZIP-archives in PHP 5.2+

Event when javascript opened/popup window is closed

If you need check if the popup window was closed by javscript, you can use this ↓

<script type="text/javascript">
function open_popup(url)
     var popup =, "", "width=450,height=250,resizable=yes,scrollbars=yes,status=yes");
    var windowCheckInterval = setInterval(function() { windowCheck(); }, 350);
        // Check function
        function windowCheck() {
            if (!popup || popup.closed) {
		alert('popup window closed');

and ↓

<a onclick="open_popup('');" href="#" >
   Open google in popup window