Integrate OSExcelBundle in your project
Add this line to the require option in your composer.json file:, (*1)
"os/excel-bundle": "dev-master"
Execute this command line, (*2)
php composer.phar update os/excel-bundle
In your app/AppKernel.php, (*3)
new OS\ExcelBundle\OSExcelBundle
USING:
Call service, (*4)
$excel = $this->get('os.excel');
Open file, (*5)
$excel->loadFile([FILE_PATHNAME]);
Select sheet, (*6)
$excel->setActiveSheet([INDEX_OF_SHEET]);
Get count of sheet, (*7)
$excel->getSheetCount();
Get sheet names, (*8)
$excel->getSheetNames();
Get count of rows of selected sheet, (*9)
$excel->getRowCount();
Get Count of columns of selected sheet, (*10)
$excel->getColumnCount();
Get index of last column, (*11)
$excel->getHighestColumn();
Get row data, (*12)
$excel->getRowData([INDEX_OF_ROW]);
Get cell data, (*13)
$excel->getCellData([INDEX_OF_ROW], [INDEX_OF_COLUMN]);
GET sheet data as php array, (*14)
$excel->getSheetData();
Enjoy!, (*15)