find('item') as $element) { if ($limit < 5) { $item = []; $item['title'] = html_entity_decode($element->find('title', 0)->plaintext); $item['timestamp'] = strtotime($element->find('dc:date', 0)->plaintext); $item['uri'] = $element->find('guid', 0)->innertext; //$item['content'] = html_entity_decode($this->extractContent($item['uri'])); $item['content'] = htmlspecialchars_decode($element->find('description', 0)->plaintext); $this->items[] = $item; $limit++; } } } private function extractContent($url) { $html2 = getSimpleHTMLDOM($url); $html2 = defaultLinkTo($html2, self::URI); foreach ($html2->find('div[style=text-align:justify]') as $e) { $text = $e->outertext; } $html2->clear(); unset($html2); $text = strip_tags($text, '


'); return $text; } }