Determine in php script if connected to internet?

if(!$sock = @fsockopen(‘www.google.com’, 80))

{

echo ‘Not Connected’;

die();

}

else

{

echo ‘Connected’;

die;

}

?>

Leave a Comment