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
Init:

$zip = new ZipArchive;

Read ZIP archive:

$zip->open('{file_location_path}');

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){
	$zip->extractTo('{file_location_extraction_path}');
	$zip->close();
}else{
	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 = window.open(url, "", "width=450,height=250,resizable=yes,scrollbars=yes,status=yes");
    var windowCheckInterval = setInterval(function() { windowCheck(); }, 350);
        // Check function
        function windowCheck() {
            if (!popup || popup.closed) {
                clearInterval(windowCheckInterval);
		alert('popup window closed');
            }
        }
}
</script>

and ↓

<a onclick="open_popup('http://www.google.com');" href="#" >
   Open google in popup window
</a>