gethostbyname
Description
The gethostbyname of Network for PHP get the IPv4 address corresponding to a given Internet host name.
Syntax
gethostbyname( string $hostname ): string
Parameters
hostname
The host name.
Return
Returns the IPv4 address or a string containing the unmodified hostname on failure.
Examples
1 · hostname
<? $hostname = 'php.net'; $return = gethostbyname($hostname); echo $return;
185.85.0.29
Links
Network
- checkdnsrr
- closelog
- dns_check_record
- dns_get_mx
- dns_get_record
- fsockopen
- gethostbyaddr
- gethostbynamel
- gethostname
- getmxrr
- getprotobyname
- getprotobynumber
- getservbyname
- getservbyport
- header
- header_register_callback
- header_remove
- headers_list
- headers_sent
- http_response_code
- inet_ntop
- inet_pton
- ip2long
- long2ip
- openlog
- pfsockopen
- setcookie
- setrawcookie
- socket_get_status
- socket_set_blocking
- socket_set_timeout
- syslog