<?php $rar_arch = RarArchive::open('filename.rar'); if ($rar_arch === FALSE)
die("Failed opening file");
$entries = $rar_arch->getEntries(); if ($entries === FALSE)
die("Failed fetching entries");
echo "Found " . count($entries) . " extract\location";
if (empty($entries))
die("No valid entries found.");
$stream = reset($entries)->getStream();
if ($stream === FALSE)
die("Failed opening first file");
$rar_arch->close();
echo "Content of first one follows:\n";
echo stream_get_contents($stream);
fclose($stream); ?>
http://php.net/manual/en/rar.installation.php如何配置PHP的RAR壓縮包安裝程序窗口
Erorr是:
Fatal error: Class 'RarArchive' not found in C:\Zend\Apache2\htdocs\CSV\example.php on line 2
謝謝很多:),但我無法設置該RAR擴展..請給我suggitions .....同樣的錯誤發生,也phpinfo()沒有顯示RAR擴展 – kim
@ kim:第一個建議 - 解釋詳細說明你所做的。 – zerkms