Combining Multidimensional Array Values in PHP

前端 未结 3 1647
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-22 08:19

I have a multidimensional array which looks like this:

Array
(
    [0] => Array
        (
            [0] => Array
                (
                           


        
3条回答
  •  不知归路
    2020-12-22 08:47

    I'm not going to write code because I agree with deceze.

    Nonetheless, my recommendation would be a custom function that:

    • loops over an input array
    • applies the logic you outlined
    • return the condensed array

    Given your specific requirements isn't a single, magical PHP function that does this. Yet, there are dozens of PHP array functions you could utilize within your custom function.

    If you need help on a particular piece, update your post or ask a new question.

提交回复
热议问题