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.
