How can I make a multidimensional array like the first key becomes the root key and the second key becomes the value?
Is there any build in function for this, if yes then which one?
My Input array is:
Array
(
[key1] => Array
(
[key] => key1
[label] => value1
)
[key2] => Array
(
[key] => key2
[label] => value2
)
[key3] => Array
(
[key] => key3
[label] => value3
)
[key4] => Array
(
[key] => key4
[label] => value4
)
)
Expected Output:
Array (
[key1] => value1
[key2] => value2
[key3] => value3
[key4] => value4
)
I can do it with iterating the for loop on array, but just looking for any existing function(s)!