Read Excel file with PHPExcel in php

940 Views Asked by At

Hi i am using PHPExcel to import contact in mysql from Excel files. Up until today everything was fine ,when one client wanted to upload excel file. I am using this code to read the excel file :

$filetype = PHPExcel_IOFactory::identify(IEM_STORAGE_PATH . "/import/{$newfilename}");
$objReader = PHPExcel_IOFactory::createReader($filetype);
            $objPHPExcel = $objReader->load(IEM_STORAGE_PATH . "/import/{$newfilename}");

            foreach ($objPHPExcel->getWorksheetIterator() as $worksheet)
            {
                $importinfo['highestRow'] = $worksheet->getHighestRow(); // e.g. 10
                $highestColumn = $worksheet->getHighestColumn(); // e.g 'F'
                $importinfo['highestColumnIndex'] = PHPExcel_Cell::columnIndexFromString($highestColumn);
            }

You can find the excel file here : https://phpexcel.codeplex.com/workitem/20675 . I have spend more than 5 hours trying to solve this problem but nothing has worked so far.

0

There are 0 best solutions below