Your Open Source

PHP

How to get the ip for the particular host

get the ip address for the given host name :

sample Code:


$host_ name = 'www.youropensource.com';
$ip = gethostbyname($host_ name);
echo $ip ;


Definition :

gethostbyname() — Get the IP address corresponding to a given Internet host name

string gethostbyname ( string $hostname )

Returns the IP address of the Internet host specified by hostname.

  • hits 109
  • datetime Mar 06 09 01:03:47
  • author Damu
  • rating

Rating : 12345

Comments

No Reply..

Quick Reply or Comments

Preview
Your Name:
Your Reply :
<> is a code tag
Enter the verification code: