我将如何从下面的 ["Actions"] 数组中提取数据:
array(3) {
[0]=>
object(stdClass)#5 (4) {
["ID"]=>
string(32) "xxxxxxxxxxxxxxxxx"
["Type"]=>
string(8) "Campaign"
["Name"]=>
string(28) "An unmissable invitation for"
["Actions"]=>
array(1) {
[0]=>
object(stdClass)#6 (4) {
["Event"]=>
string(4) "Open"
["Date"]=>
string(19) "2013-04-30 19:01:00"
["IPAddress"]=>
string(14) "xxx.xxx.xxx.xxx"
["Detail"]=>
string(0) ""
}
}
}
我可以通过执行以下操作提取该数组上方的任何内容:
foreach($result->response as $entry) {
echo '<tr>';
echo '<td>'.$entry->ID.'</td>';
echo '<td>'.$entry->Type.'</td>';
echo '<td>'.$entry->Name.'</td>';
echo '<td>'.$entry->Actions["Event"][0].'</td>';
echo '</tr>';
}