我有一个返回这样一个数组的函数
Array
(
[0] => stdClass Object
(
[tid] => 1
[vid] => 2
[name] => About Us
[description] =>
[format] => wysiwyg_editor
[weight] => 0
[depth] => 0
[parents] => Array
(
[0] => 0
)
)
[1] => stdClass Object
(
[tid] => 200
[vid] => 2
[name] => Stories
[description] =>
[format] => wysiwyg_editor
[weight] => 0
[depth] => 0
[parents] => Array
(
[0] => 0
)
)
)
为了简化它以供进一步使用,我想将此数组转换为简单的数组,其中键为 [tid],值为 [name] 所以它会是这样的:
Array
(
[1] => About Us
[200] => Stories
)
任何有关正确代码语法的提示或帮助都会很棒。谢谢