import('ORG.Util.PHPExcel.PHPExcel');
$objReader = new PHPExcel_Reader_Excel2007(); //use excel2007
$objPHPExcel = $objReader->load($filename); //指定的文件
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow(); // 取得总行数
$highestColumn = $sheet->getHighestColumn(); // 取得总列数 for($j = 1;$j <= $highestRow; $j++) {
$cell = $objPHPExcel->getActiveSheet()->getCell("A".$j)->getValue();
$data[] = array('typeid'=>$ggtid, 'serverid'=>$ggsid, 'cardno'=>$cell);
}
查看代码