Array Flatten

Posted 10 months ago by InspiredPrynce

I have data like this...


array:9 [▼
  0 => array:1 [▼
    3101625668 => 98.0
  ]
  1 => array:1 [▼
    3913126364 => 35.77
  ]
  2 => array:1 [▼
    3913058204 => 25.33
  ]
  3 => array:1 [▼
    3101372540 => 33.47
  ]
  4 => array:1 [▼
    3913752741 => 40.0
  ]
  5 => array:1 [▼
    3913120054 => 20.4
  ]
  6 => array:1 [▼
    3913998755 => 26.8
  ]
  7 => array:1 [▼
    3913861492 => 25.2
  ]
  8 => array:1 [▼
    3913881854 => 19.8
  ]
]

I want to flatten the array to something like this..

[$key => $value]

Please Laravel doesn't seem to be of much help.. Someone please help!

Please sign in or create an account to participate in this conversation.