PHPAcademy provided this wonderful 2-part tutorial on how to code a short function to check if a given website is online or down currently. Similar functionality can be seen at isup.me.
http://www.youtube.com/watch?v=1eDOo9Sw3GE
http://www.youtube.com/watch?v=dKnGgRci49Q