1 回答
TA贡献1818条经验 获得超8个赞
请参阅文档foreach 应符合以下语法:
foreach (array_expression as [$key =>] $value) statement
这个简单的代码将帮助您:
<?php
$array = array
(
"object" => "page",
"entry" => array( array (
"id" => 486382132468113,
"time" => 1597838601,
"changes" => array ( array (
"value" => array
(
"form_id" => 388595733337796,
"leadgen_id" => 634975333342066,
"created_time" => 1597838600,
"page_id" => 486382333368113
),
"field" => "leadgen"
)
)
)
)
);
foreach ($array["entry"] as $entry) {
echo "Time:". $entry['time'] . "<br>" ;
foreach ($entry['changes'] as $change) {
echo "Lead ID:". $change['value']['leadgen_id'] . "<br>" ;
}
}
- 1 回答
- 0 关注
- 85 浏览
添加回答
举报