我在 PHP 中工作。
我有一个数组。我需要创建像([CN] => Chinese
)这种格式的语言数组。
我的数组响应如下。
Array
(
[0] => stdClass Object
(
[language_name] => Chinese
[language_code] => CN
)
[1] => stdClass Object
(
[language_name] => English
[language_code] => EN
)
[2] => stdClass Object
(
[language_name] => Korea
[language_code] => KO
)
[3] => stdClass Object
(
[language_name] => Vietnamese
[language_code] => VN
)
)
我需要转换这种类型的数组
Array(
[CN]=>Chinese
[EN]=>English
[KO]=>Korea
[VN]=>Vietnamese
)
我怎样才能做到这一点?