How to extract zip files from server directly using php

All of servers not providing cpanel/GUI to access the files. Uploading through FTP will be a great deal and it will time consuming if there are number of files. For eg: if we are uploading CMS like WordPress, joomla, magento, there will be no of files (more than 2000+ files).

In this case i would suggest to upload the zip file via ftp and use a php extract method by adding the following code.

$zip = new ZipArchive();
$x = $zip->open('');//your zip file name here
if ($x === true) {
 $zip->extractTo(dirname(__FILE__)); // change this to the correct site path

This will reduce the delay in uploading.