请问一个基本的问题。有人可以帮助我获得所有三个主要类别字符串(要做的事情、交通和生活)。我只发现了如何单独获取它们
$categories[0]->maincategory;
但我怎样才能得到这三个?最好的感谢!
Array
(
[0] => stdClass Object
(
[id] => 2
[maincategory] => Things to Do
[category] => Activities and Attractions
)
[1] => stdClass Object
(
[id] => 6
[maincategory] => Transportation
[category] => Airport Transfers
)
[2] => stdClass Object
(
[id] => 11
[maincategory] => Living
[category] => Broadband Internet
)
)