我目前正在使用以下方法从网页获取日期
foreach($returned_content->find('div.box-inset') as $article) {
$item['dates'] = $article->find('div.important-dates', 0)->plaintext;
$articles[] = $item;
}
var_dump($articles);
这将输出以下内容
array(2) { [0]=> array(1) { ["dates"]=> string(235) " Important Dates Expires On October 28, 2013 Registered On October 29, 2012 Updated On October 29, 2012 " } [1]=> array(1) { ["dates"]=> NULL } }
理想情况下,我希望将结果按如下所示列出
- 重要的日子
- 2013 年 10 月 28 日到期
- 2012 年 10 月 29 日注册
- 更新于 2012 年 10 月 29 日
但是我迷失了让内容像echo $articles
刚刚产生的那样正确回显,Array
而且我以前从来没有像这样的数组