Throw, separate symbols"/> if(preg_match("@.*(query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // XKCD (alt tags we don't.