How to extract zip files in php?

H

PHP has built in feature to extract zip files, you can use this simple code to extract zip files without use of any library

<?php
     $zip = new ZipArchive;
     $res = $zip->open('archive.zip');
     if ($res === TRUE) {
         $zip->extractTo('./');
         $zip->close();
         echo 'ok';
     } else {
         echo 'failed';
     }
?> 

There are many features that PHP’s zip archive class offers. You can check full documentation for futher details.