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