English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The gethostbyaddr() function retrieves the hostname corresponding to the specified IP address.
string gethostbyaddr ( string $ip_address )
Used to obtain the IP address of the given Internet hostname
Returns the hostname if successful; if failed, returns the original output (output IP address); if the input format is abnormal, returns FALSE.
Number | Parameters and Description |
---|---|
1 | ip_address The IP address of the host. |
Try the following examples
<?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); echo $hostname; ?>
The example above returns the result of the hostname