Use PHP to Retrieve All Links on a Page
I was developing a project recently, where I had the need to get all the links on a certain page. I first turned to a JavaScript library, like Jasmine. I really wanted to do this within my PHP code, so I ended up going with this solution: $html = file_get_contents(‘http://www.example.com’); $dom = new DOMDocument(); @$dom->loadHTML($html); […]