我有'N'個單維數組(其中N表示由sql命令檢索到的記錄數) 如何將其轉換爲多維數組,其中鍵爲索引? 起初我還以爲創建一個單獨的密鑰數組,然後將其與這N個陣列相結合的將多個單維數組轉換爲單個多維數組php
我的輸出
Array ([0] => PONDICHERRY [1] => 31-Jan-2018 [2] => [3] => distance and height are not proportional.)
Array ([0] => PONDICHERRY [1] => 03-Feb-2020 [2] => [3] => helloooooooooooooo)
我的預期輸出
Array ([0] => Array ([0] => PONDICHERRY [1] => 31-Jan-2018 [2] => [3] => distance and height are not proportional.) [1] =>Array ([0] => PONDICHERRY [1] => 03-Feb-2020 [2] => [3] => helloooooooooooooo) )
這是我很難給陣列組合,但我如何創建這樣的?
謝謝
兩個不同的陣列不是使用$改編[] = array_merge – devpro