find('div.an-article') as $element) { if(count($this->items) >= 10) { break; } $article_title = trim(strip_tags($element->find('h2', 0)->innertext)); $article_uri = substr($element->find('a', 0)->href, 0); //$article_thumbnail = self::URI . substr($element->find('img', 0)->src, 3); //$article_content = ''; $article_content = trim(strip_tags($element->find('p.excerpt', 0)->innertext)); //$article_timestamp = strtotime($element->find('time', 0)->attr['datetime']); $article_uid = trim(strip_tags($element->find('h2', 0)->innertext)); // Store article in items array if (!empty($article_title)) { $item = array(); $item['uri'] = $article_uri; $item['title'] = $article_title; //$item['enclosures'] = array($article_thumbnail); $item['content'] = $article_content; //$item['timestamp'] = $article_timestamp; $item['uid'] = $article_uid; $this->items[] = $item; } } } }