How to group subarrays by a column value?

前端 未结 18 2052
一生所求
一生所求 2020-11-22 10:43

I have the following array

Array
(
    [0] => Array
        (
            [id] => 96
            [shipping_no] => 212755-1
            [part_no] =&         


        
18条回答
  •  生来不讨喜
    2020-11-22 11:16

    Check indexed function from Nspl:

    use function \nspl\a\indexed;
    $grouped = indexed($data, 'id');
    

提交回复
热议问题