3
1
Back

= $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ if ($img->getAttribute('title')) { $article['content'] = preg_replace("@@", '', $article['content']); // Joy of Tech Scenes From A Multiverse (to get alt tags) elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { $article['content'] .= "
Alt: " . $img->getAttribute('title') . ""; } } // Dead Philosophers elseif (strpos($article['link'], 'http://www.achewood.com/index.php?date=') !== FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } Clean up code formatting; added a few.

New Pull Request