我讀兩個Excel文件,使用PHP-Excel的讀者(From this)如何關閉Excel文件中的php-Excel的讀者
閱讀第一排的兩個文件後,我比較,如果它們是相同的那麼我追加包含對文件等。要寫出我使用this
文件現在做這個,我要關閉的一個文件,但該功能在PHP-Excel的讀者提供
這裏是我的代碼
compare file
{
$data = new Spreadsheet_Excel_Reader($filepath);
$data1 = new Spreadsheet_Excel_Reader($destinationfilepath);
}
unset($data);
unset($data1);
if($flag==0)
{
$excel = new ExcelWriter($destinationfilepath);
// read the source file
$finalarray= array();
for($m=1;$m<$sourcefilerowcount;$m++)
{
$charvalue='A';
$temprow=$m+1;
for($n=0;$n<$destinationcolnum;$n++)
{
$data = new Spreadsheet_Excel_Reader($filepath);
$finalarray[$n]=$data->val($temprow,$charvalue);
$charvalue++;
}
print_r($finalarray)."<br/>";
$excel->writeLine($finalarray);
}
其代碼我想'$ excel->接近();'[http://www.vijayjoshi.org/2009/12/15/how-to-create-excel-files-in-php/](http://www .vijayjoshi.org/2009/12/15 /如何到創建-Excel的文件正在PHP /) – swapnesh
ya.but爲PHP-Excel的讀者我沒有得到。 $ data1 =新的Spreadsheet_Excel_Reader($ destinationfilepath);如何關閉$ data1? – snehal
@ 2492230你可以使用'取消設置($數據1);' – swapnesh