How can I check if I\'m connected to the internet from my PHP script which is running on my dev machine?
I run the script to download a set of files (which may or ma
/* * Usage: is_connected('www.google.com') */ function is_connected($addr) { if (!$socket = @fsockopen($addr, 80, $num, $error, 5)) { echo "OFF"; } else { echo "ON"; } }