find('ul.l_newslink li') as $element) { if(count($this->items) >= 10) { break; } $article_title = trim(strip_tags($element->find('p.newslink_txt', 0)->innertext)); $article_uri = self::URI . substr($element->find('a', 0)->href, 0); // strtotime() doesn't seem to like the missing zeroes in the month $article_time = trim(strip_tags($element->find('div.newslink_date', 0)->innertext)); $article_timestamp = date_format(date_create_from_format("Y.m.d", $article_time), "d.m.Y"); // Store article in items array if (!empty($article_title)) { $item = array(); $item['uri'] = $article_uri; $item['title'] = $article_title; $item['timestamp'] = $article_timestamp; $this->items[] = $item; } } } }