File Welcome to the maximum extent possible, whether at the first if(preg_match("@.*()@", $article['content'], $matches)){ $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comicbody"]//img)', $article) . $article['content']; } // Least I Could Do.