我有一个数组......这是结构/数据:
array(1) {
[0]=> object(SimpleXMLElement)#1 (18)
{
["data_123"]=> object(SimpleXMLElement)#3 (29)
{
["field1"]=> string(7) "123"
["field2"]=> string(2) "10"
["field3"]=> string(19) "2013-03-05 17:00:00"
["field4"]=> string(19) "2013-03-05 18:00:00"
}
["data_234"]=> object(SimpleXMLElement)#4 (29)
{
["field1"]=> string(7) "234"
["field2"]=> string(2) "10"
["field3"]=> string(19) "2013-03-05 17:40:00"
["field4"]=> string(19) "2013-03-05 18:10:00"
}
}
}
我正在尝试创建一个循环来显示数据,但没有显示任何内容:
foreach ($result as $key => $list) {
echo "key.: " . $key . "\n";
echo "field1: " . $list['field1'] . "\n";
echo "field2: " . $list['field2'] . "\n";
}
它只是不返回任何数据。
我猜这个数组结构的循环可能是错误的?
我怎样才能得到这个数组的回显数据?