我正在使用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
)
我如何能做到這一點的轉換?