Two php functions for scraping content and extracting links