listWorksheetInfo($xlfile); #var_dump($worksheetData); #[0] ["worksheetName"]=>string(6) "Sheet1" # ["lastColumnLetter"]=>string(1) "C" # ["lastColumnIndex"]=>int(2) # ["totalRows"]=>string(1) "3" # ["totalColumns"]=>int(3) $objPHPExcel = PHPExcel_IOFactory::load($xlfile); $sheet = $objPHPExcel->getSheet(0); $highestRow = $sheet->getHighestRow(); $highestColumn = $worksheetData[0]["lastColumnLetter"]; ## $sheet->getHighestColumn(); #print "hRxhC = $highestRow x $highestColumn;\n"; #print "-------------\n"; #for ($row = 1; $row <= $highestRow; $row++){ # // Read a row of data into an array # $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, # NULL, # TRUE, # FALSE); # // Insert row data array into your database of choice here # var_dump($rowData); #} #print "-------------\n"; $rowData = $sheet->rangeToArray("A1:".$highestColumn.$highestRow); #'A' . $row . ':' . $highestColumn . $highestRow, NULL,TRUE,TRUE); var_dump($rowData); print "-------------\n"; #$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true); #var_dump($sheetData); ?>