I access a RSS feed and the content is displayed in my website using PHP. There are times when there is no result from the RSS feed. How do i capture this so that i can display data from another source when the RSS feed fails.
I would like to capture the following when i access the RSS Feed : 1> Blank Result / No Result (Server us Up and running) 2> Server Response Very Slow or Server Down 3> Errors (Server us Up and running)
So you can determine if the function failed or not and what the error is. Also you could cache the results daily instead of getting the feed with each request.
If the fp is false meaning the call failed then you could try another page to get your feed from. The 5th parameter is the timeout in secs. You could set it up so the code won't wait too long for a connection.