0
我開始與這些代碼PHPExcel只返回空單元格值
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
$cacheSettings = array('memoryCacheSize' => '128MB');
$cacheEnabled = PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
if (!$cacheEnabled)
{
# WARNING - Cache to php temp not enableable ###" . PHP_EOL;
}
$inputFileType = PHPExcel_IOFactory::identify($file_path);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($file_path);
$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
然後
$highestRow = $objWorksheet->getHighestRow();
收益2560好了,我的Excel與人口2560行。
然後我循環
for ($x =1; $x<=$highestRow; $x++) // here $x plus plus ...
{
$ean = $objWorksheet->getCellByColumnAndRow(15, $row)->getValue();
$description = $objWorksheet->getCellByColumnAndRow(13, $row)->getValue();
echo $ean .":" .$description . PHP_EOL;
}
但每一行是空的,只有2560 「:」 被打印出來。
所以我想轉儲整行,因爲我真的不明白爲什麼返回的值是空的!從A到BC,從1到2560的每張單頁紙都充滿了一些價值。
爲什麼所有的單元格看起來都是空的? 如何調試?
該死的,多麼愚蠢...... – realtebo