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
You can always ping good 'ol trusty google:
$response = null; system("ping -c 1 google.com", $response); if($response == 0) { // this means you are connected }