3
1
Back

$doc->loadHTML($article['content']); //no-op $imgs = $xpath->query('//img'); //doesn't get simpler than this // only keep everything starting at the first foreach($imgs as $img){ foreach ($imgs as $img) { if (preg_match("@.*(get_img_tags($xpath, "//div[@id='comic-1']//img", $article); } // Awkward Zombie $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='singleImage']/img[@class='magicfields']", $article); $article['content'] = $doc->saveHTML(); function get_img_tags($xpath, $query, $article, $base_url=NULL) { $img_attributes_whitelist = array('src', 'alt', 'title'); if (!$base_url){ $base_url = $article['link']; } From.

New Pull Request