I’ve found various methods:
- Check serverlist offline / online PHP
- http://css-tricks.com/snippets/php/check-if-website-is-available/
But was curious on the best / most efficient to use or any alternatives.
I’m using the yahoo currency API for my script and I want to add a fallback API incase the yahoo currency goes down. How can I detect this?
What if the service goes down after you check if its up but before you use it?
Instead, just call the api. If you do not get a result, then use your fall back method.
Also, just because a server is online doesn’t mean that the services on it are not in some way broken. The only real way to test it is to use it.