English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The gethostbyname() function returns the IPv4 address corresponding to the hostname.
string gethostbyname ( string $hostname )
Returns the IPv4 internet address corresponding to the hostname hostname.
Returns the IPv4 address when successful, and returns the hostname string unchanged when failed.
Parameter | Description |
---|---|
hostname | It gives the corresponding hostname |
Try the following example
<?php $ip = gethostbyname('ru.oldtoolbag.com'); echo $ip; echo $hostname; ?>
The above example shows the result of the w3codebox IPV4 address.