Home > PHP > is this site live or dead

is this site live or dead

sometimes we need to import data from other site though we don’t know when we need to use their data from their site,will this site alive or dead?We can fix this problem via a php function called fsockopen,now i have a script that can work for you to understand more precisely

<?php

$up = @fsockopen("www.wordpress.com", 80, $errno, $errstr, 30);
if($up)
{
echo "Wordpress is Alive";
}
else
{
echo "Sorry this site is not available now";
}
?>

that’s it. Now check it out.

Advertisements
Categories: PHP
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: