title: Determine in php script if connected to internet?
body: <p>How can I check if I'm connected to the internet from my PHP script which is running on my dev machine?</p>
  
  <p>I run the script to download a set of files (which may or may not exist) using wget. If I try the download without being connected, wget proceeds to the next one thinking the file is not present.</p>