我有以下多維數組:打破多維數組在PHP
Array ([0] => stdClass Object ([array] => Array ([0] => 6112010651088 [1] => Bill [2] => Choice)) [1] => stdClass Object ([array] => Array ([0] => 6702015707081 [1] => test [2] => data2)))
如果你打破第一個數組下使用
foreach ($point1 as $val)
{
print_r($val);
}
你:
stdClass Object ([array] => Array ([0] => 6112010651088 [1] => Bill [2] => Choice))
stdClass Object ([array] => Array ([0] => 6702015707081 [1] => test [2] => data2))
所以基本上你有一個數組有2個對象的數組,每個數據有3個單位,我如何訪問這個對象stdClass數組now,cos如果我去$ VAL [0],而不是$ VAL我得到
Fatal error: Cannot use object of type stdClass as array
Tnks傢伙的幫助:) – David
請選擇一個答案。 – MasterCassim