An image/link extractor in PHP