Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Extract Zip File Using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 110
    Comment on it

    If we do not have access to shell and we want to extract a zip file then just put the below php piece of code and run.

    $zipObj = new ZipArchive;
    $file = $zipObj->open(zip_file_name.zip);
    if ($file == TRUE) {
        $zipObj->extractTo('extract_directory/');
        $zipObj->close();
        echo 'Unzip Successfully';
    } else {
        echo 'Failed to unzip';
    }
    

    It will work for you.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: