Jump to content


This topic is now archived and is closed to further replies.


Is there a function to check if an URL is a valid resource for fopen?

Recommended Posts

My loop gets a list of URLs in my DB and scans those URLs using fopen (the reason is to scan my supplier's site to update prices). It consists of a while loop to get all of the URLs from each record and then update them one by one. The problem is that some of the URL's link to pages that aren't on the site anymore and I don't have the time to go round checking them all. When the loop comes to one of the invalid URLs, the script stops processing all the other records and I just get errors about it not being a valid resource for fopen.

So is there a function to check this, where it only actually does open the page if it is valid; hopefully this will avoid the errors and not stop the script.


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.