3
1
Back

$imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { $article['content'] .= "
ID: " . $article['id']; } function get_img_tags($xpath, $query, $article){ $entries = $xpath->query("//div[@id='comic-notes']"); foreach ($entries as $entry){ $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; } } return $article; } if(ADD_IDS){ $article['content'] .= "
Alt: " . $img->getAttribute('title') . ""; } //noop } // XKCD (alt tags we don't need.

New Pull Request