Merging 2 arrays by keys

前端 未结 1 717
耶瑟儿~
耶瑟儿~ 2021-01-28 23:18

There are 2 arrays, the reason for 2 arrays is because of 2 drop down from form post.

array1
1 => 878
2 => 983
3 => 717

array2
1 => 10
2 => 15
3          


        
相关标签:
1条回答
  • 2021-01-29 00:17

    using the array_combine. try it here

    $combined = array_combine(array_values($array1),array_values($array2));
    
    0 讨论(0)
提交回复
热议问题