Jump to content

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


gnuffo1

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.

Thanks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.