What are the limitations of using the ZipArchive class in PHP for extracting password-protected ZIP files?

The ZipArchive class in PHP does not have built-in support for extracting password-protected ZIP files. To work around this limitation, you can use a third-party library like PHPExcel or ZipArchiveExtended that supports password-protected ZIP files.

// Example using PHPExcel library to extract password-protected ZIP file
require_once 'PHPExcel/IOFactory.php';

$zip = new ZipArchive();
if ($zip->open('password_protected.zip') === TRUE) {
    $zip->setPassword('your_password_here');
    $zip->extractTo('extracted_folder/');
    $zip->close();
} else {
    echo 'Failed to open the ZIP file.';
}