Created
September 17, 2014 16:15
-
-
Save thotbox/b72a8d9d41f50a125f52 to your computer and use it in GitHub Desktop.
PHP: Test For Internet Connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connected = @fsockopen("www.workwiththey.com", 80); | |
if ($connected) { | |
echo "connected"; | |
fclose($connected); | |
} else { | |
echo "not connected"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment