【发布时间】:2010-07-30 21:21:47
【问题描述】:
这是我想要的,但不知道怎么做。
$a 是这个数组 PHP代码:
Array
(
[0] => stdClass Object
(
[id] => i1
[cat] => Test1
)
[1] => stdClass Object
(
[id] => i2
[cat] => Test2
)
[2] => stdClass Object
(
[id] => i3
[cat] => Test3
)
[3] => stdClass Object
(
[id] => i4
[cat] => Test4
)
}
这是一个数组,它有与之关联的那些标准类。我要做的是将所有“猫”名称组合到一个数组变量中。
我想让 $categories 成为一个数组,所有这些“猫”作为数组值。
我该怎么做?
【问题讨论】: