//去除空格造成的空行 $rowStr = trim(implode("",$row)); if(!empty($rowStr)){ $arr[$currentRow] = $row; } //$row为每一行获取得到的数组