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