Skip to content
Advertisement

How to merge array using UUID value

I have the following code :

JavaScript

Which give me the following error :

JavaScript

Snippet :

https://sandbox.onlinephpfunctions.com/c/cf5fd

I want to use the UUID as an array id.

here is the expected output :

JavaScript

Advertisement

Answer

Instead of use array_combine you need to use array_merge_recursive because is multidimensional

Snippet: https://sandbox.onlinephpfunctions.com/c/eae35

Reference:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement