0
Я пытаюсь прочитать ряд значений из Excel. Это код, который я использую.Получение диапазона значений от excel с помощью PHPExcel
// Include PHPExcel_IOFactory
include 'Classes/PHPExcel/IOFactory.php';
$inputFileName = 'test.xlsx';
// Read your Excel workbook
try {
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
} catch(Exception $e) {
die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
}
$cellValue = $objPHPExcel->getActiveSheet()->getCell('A1')->getValue();
echo "A1 is: ".$cellValue."<br>";
$dataArray = $objPHPExcel->getActiveSheet()
->rangeToArray(
'A1:C1', // The worksheet range that we want to retrieve
NULL, // Value that should be returned for empty cells
TRUE, // Should formulas be calculated (the equivalent of getCalculatedValue() for each cell)
TRUE, // Should values be formatted (the equivalent of getFormattedValue() for each cell)
TRUE // Should the array be indexed by cell row and cell column
);
echo "number of items in array: ".count($dataArray);
По какой-то причине подсчета $dataArray
является только 1, хотя я извлечением диапазона, который должен соответствовать 3 ст. В чем может быть проблема?