Array
(
[9] => stdClass Object
(
[tid] => 9
[vid] => 3
[name] => Domestic
[description] => Domestic
[weight] => 0
)
[12] => stdClass Object
(
[tid] => 12
[vid] => 3
[name] => Economic
[description] => Economic
[weight] => 1
)
[11] => stdClass Object
(
[tid] => 11
[vid] => 3
[name] => International
[description] =>
[weight] => 2
)
)
假設print_r($ child)的結果是上面的,我如何回顯所有的tid和名字,我該怎麼辦?如何輸出結果?
foreach($child as $arr){
foreach($arr as $key=>$vaule)
{
...
我不知道如何循環它們。
它不輸出任何內容。 GDD回答正確 – 123
輸出Tid:和Name:Tid:和Name:.... – 123
糟糕 - 沒有注意到元素是對象。更正它。 –