我从数据库中获取了这个数组......如何获得确切的值属性......
Array
(
[0] => TRowResult Object
(
[row] => tests
[columns] => Array
(
[a21ha:link_0] => TCell Object
(
[value] =>testsample
[timestamp] => 1265010584060
)
[a21ha:link_1] => TCell Object
(
[value] => example
[timestamp] => 1265092697040
)
)
)
如何在php中单独获取[value]
答案 0 :(得分:3)
print $myArray[0]->columns['a21ha:link_0']->value;
这会给你第一个。为了得到所有,你必须遍历内容。
foreach ($myArray[0]->columns as $column) {
print $column->value;
}
答案 1 :(得分:1)
假设您的数组名为$ array:
foreach($array as $arridx => $rowobj){
foreach($rowobj->columns as $cellid => $rowcell){
echo $rowcell->value;
}
}