如何一次推送()数组中的数据

if ($file_extension == "xlsx") { include("excel/PHPExcel.php"); include("excel/Excel2007.php"); $objPHPExcel = PHPExcel_IOFactory::load($_FILES['filename']['tmp_name']); $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); foreach($sheetData as $row) { //// How to put all cells in array in one shot because we can not assign each like $row['A'] ,$row['B'] array_push($array, strval($row['A'])); //row A2; //array_push($array,strval($row['B'])); //etc... } } 

如何将所有单元格放在一个数组中而不指定名称?

因为编写$row['A']$row['B']$row['C'] …… For Each是非常困难的。

如何将所有数据放入数组而不分配行的名称?

您可以合并数组

 $array = array_merge($array, $row);