×
Please Join Softare On Facebook

Don't Forget To Join With Our Community

Enter Your Email Address :-

Please Check Your Email Inbox For Complete Subscription

Keywords

3D Logo Text Mockup Antivirus Apple iOS7 app Icons Backgrounds BisListe Blank t-shirt template Blog Templates Blog Tricks bluestack Brushes business doodles Business Website Template cache cache plus Chrome Chrome Layouts CodeCanyon compress your jpg images Corporate Branding Mockup Dashboard UI Elemets Deals Design Articles Design Bundles Design Inspiration Domain Easter Eggs eCommerce Flat UI Kit Elegant Themes Facebook facebook like all Firefox Fonts Free Photos Free PSD Files Free Stuff Free Wordpress Theme freebies Giveaway Google Google Chrome Themes Graphics Graphics Icons Hosting how to see google cache version webpage HTML Template icons Icons Design Infographic Elements iPhone 5C Mockup iPhone 7 Concept JPEGmini Latest Updates Layouts Light Music UI Elements logos Magento and Opencart Theme Magnifying Glass Miscellaneous Mockup PSD Mockup template parallax Patterns Photoshop Actions Photoshop Gradients Photoshop Patterns Photoshop Resources Photoshop Tutorials PHP PNG Files Premium Blogger Template Premium Wordpress Themes PSD PSD Templates Quotes Responsive Responsive Blogger Template Responsive Wordpress Theme Review and Rating Stars run android apps on pc SEO Shop Sketch App Files Social Media Icons Software Templates Text Effects Textures ThemeForest Themes Timeline Remove Tips Tools & Utilities Top Download Trial Buy Buttons Tricks UI & Mobile Apps UI Element UI Elements UI Kits Uncategorized vector ribbons vectors Web Buttons Website Layouts Website Traffic Websites Windows Wordpress Plugins Wordpress Themes

Friday 16 May 2014

How To Unzip or Extract The Content of Zip File Using PHP

How To Unzip or Extract The Contant of Zip File Using PHP

Sometimes you want to extract the content of zip file online. So in this article I will tell you how to extract or unzip the content of zip file using php
<?php 
  $zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
  $zip->extractTo($_SERVER['DOCUMENT_ROOT']."/FOLDERPATH");
  $zip->close();
  echo 'ok';
} else {
  echo 'failed';
}
?>

PHP Function : 
// Function 
function zip_extract($file, $extractPath) {
    $zip = new ZipArchive;
    $res = $zip->open($file);
    if ($res === TRUE) {
        $zip->extractTo($extractPath);
        $zip->close();
        return TRUE;
    } else {
        return FALSE;
   }
}
As I always here, if you get into troubles, you can use the comment form or Our Facebook Page !

0 comments

Post a Comment

Thanks For Visit :)

Note: only a member of this blog may post a comment.