Home > PHP > Function > Network > gethostbyname()

gethostbyname()

gethostbyname - Get the IPv4 address corresponding to a given Internet host name

Syntax

string gethostbyname (string $hostname)

Arguments

  • hostname - The host name.

Description

Returns the IPv4 address of the Internet host specified by hostname.

Version

PHP 4, 5

Return value

Returns the IPv4 address or a string containing the unmodified hostname on failure.