【发布时间】:2015-06-18 09:37:06
【问题描述】:
我想访问下图中的int20和int30。我该怎么做?
这是我的 var_dump 结果:
array (size=2)
0 =>
array (size=1)
0 =>
object(stdClass)[238]
public 'time' => int 20
1 =>
array (size=1)
0 =>
object(stdClass)[242]
public 'time' => int 30
这是我的查询:
$sum_time = array();
foreach ($a as $f) {
$sum_time[] = DB::select("select time from quiz where '$f'=id");
}
var_dump($sum_time);
【问题讨论】:
-
在 stdclass 上使用 -> 例如你的例子中的时间 $theObject->time