How can I check if I am connected to the Internet from my PHP script that runs on my dev machine (and not on the server somewhere)?
I am running a script to load a set of files (which may or may not exist) using wget. If I try to download wget without connecting, wget moves on to the next one, thinking that the file is missing, so I need to check before calling wget.
source
share