public function ss()
{
$path = 'G:\PHP\Goods\uploads\20190715\4ff70347056c40876cda40e2f2fde18c.csv';
try {
//注意 setInputEncoding('GBK') 不设置将导致中文列内容返回boolean(false)或乱码
$objReader = \PHPExcel_IOFactory::createReader('CSV')->setDelimiter(',')->setInputEncoding('GBK');
$objPHPExcel = $objReader->load($path);
$sheet = $objPHPExcel->getSheet(0); // 读取第一个工作表
$highestRow = $sheet->getHighestRow(); // 取得总行数
$highestColumm = $sheet->getHighestColumn(); // 取得总列数
$str = "";
for ($row = 1; $row <= $highestRow; $row ++) { // 行数是以第1行开始
$str .= $row;
// 输出excel表格的内容
for ($column = 'A'; $column <= $highestColumm; $column ++) {
$str .= $sheet->getCell($column . $row)->getValue() . "|";
}
$str .= '|' . PHP_EOL;
}
echo $str;
} catch (\Exception $e) {
$this->error($e->getMessage());
}
return;
}