Box/Spout примеры

composer require box/spout

Пример

use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;

//$reader = ReaderEntityFactory::createReaderFromFile('pricelist.csv');
//$reader = ReaderEntityFactory::createCSVReader();
$reader = ReaderEntityFactory::createXLSXReader();
$reader->open('pricelist.xlsx');

foreach ($reader->getSheetIterator() as $sheet) {
    foreach ($sheet->getRowIterator() as $row) {
     
		echo $row->getCellAtIndex(1)->getValue()."<br>";
       
    }
}

$reader->close();