.xls
ファイルを読み取り、配列に格納する必要があります。私はlaravel-excelパッケージを使用して、Excelファイルを読み込みます。Laravel-Excelが最初の行を列名として読み取る理由
が、私はこのような配列を持っている必要があります:
私は、Excelは、このようなファイル持って
[
'9921234567' => 'First Text',
'9929876544' => 'Second Text',
'9927654321' => 'Third Text',
'9928765432' => 'Fourth Text',
]
私がこれまでにしようとしているもの:
Excel::load('sample.xls', function($reader) {
$reader->dd();
});
問題:
問題は、最初の行を列として読み取ることです。
0 => RowCollection {#619
#title: "Sheet1"
#items: array:3 [
0 => CellCollection {#623
#title: null
#items: array:2 [
9921234567 => 9929876544.0
"first_text" => "Second Text"
]
}
1 => CellCollection {#624
#title: null
#items: array:2 [
9921234567 => 9927654321.0
"first_text" => "Third Text"
]
}
2 => CellCollection {#625
#title: null
#items: array:2 [
9921234567 => 9928765432.0
"first_text" => "Fourth Text"
]
}
]
}
見てください、私は最初の行値を列名としてカウントしたくありません!
ご協力いただければ幸いです。
いいえ...同じ問題 –