我有一个数组,格式如下。
Array
(
[0] => Array
(
[keyword] => thumbnail_follow
[content] => width
)
[1] => Array
(
[keyword] => thumbnail_resize
[content] => yes
)
)
我希望得到如下输出结果:
Array
(
[thumbnail_follow] => width
[thumbnail_resize] => yes
)
我目前尝试过什么?
array_shift()
but this remove duplicate keys and output becomeArray ( [keyword] => thumbnail_follow [content] => width )
array_column
I am able to get only single type of values. For examplearray_column($array, 'keyword')
Array ( [0] => thumbnail_follow [1] => thumbnail_resize )
array_column
和loop
,我可以获得期望的输出,但一定存在更有效的方法,但是我不知道。你们能帮我吗?