im currently struggling with converting this array in PHP to a more simplified one. This is my array to start with stored in $array
:
[0] => Array
(
[name] => name-1
[value] => xXX
)
[1] => Array
(
[name] => name-2
[value] => YYY
)
I would like to transfrom this array to this simplified one $array_new
:
[0] => Array
(
[name-1] => xXX
)
[1] => Array
(
[name-2] => YYY
)
I sadly don't know were to start... Could somebody help me out?
Edit: After I converted the array via array_column() oder foreach loop I still cant get the right data with $array_new['name-2'];