I'm running a service which involved a website owner having to put a piece of code onto their website. It doesn't matter which page it goes on. 

I'm looking for a way using PHP to check the pages of a given website URL for a piece of code. Could anyone point me in the right direction?

I know how to scan the page of a given URL, but I need a way of collecting all of the page URLs with PHP and searching each one of these pages for a line of code.

Thanks! :)