I have this code:
foreach($html->find('ul.results') as $article) { $item['date'] = $article->find('span.result_date', 0)->plaintext; $item['title'] = $article->find('a.result_title', 0); $item['text'] = $article->find('span.result_text', 0)->plaintext; $item['read'] = $article->find('a.read_more', 0); $articles[] = $item; } foreach ($articles as &$item) { while ($i < 5) { echo $item['date']." "; echo $item['title'].'</br>'; echo $item['text']." "; echo $item['read'].'</br></br>'; $i++; } } And I am trying to echo the results. Right now the second foreach isn't doing anything. It is just displaying five of the same articles. The articles are in the format of: date, title, text, read more. I am trying to eco the first five $articles, but I can't find a proper way to do so that isn't print_r.
print_r($articles)?