gethostbyname & gethostbyaddr

gethostbyname & gethostbyaddr

gethostbyname
===========

gethostbyname
It  get the IP address corresponding to a given Internet host name.
It returns the IP address of the Internet host specified by hostname.

Syntax:
=====
string gethostbyname ( string hostname)

gethostbyaddr
===========

gethostbyaddr
- It get the Internet host name corresponding to a given IP address.
It returns the host name of the Internet host specified by ip_address. If an error occurs, returns ip_address.

Syntax:
=====
string gethostbyaddr ( string ip_address)

Example:
======

echo $str = gethostbyname(”system1″);

The Output of the above Statement is 192.168.12.1.

echo $str = gethostbyaddr(’192.168.12.1′);

The Output of the above Statement is system1.

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.