Current Location: Home> Function Categories> gethostbyname

gethostbyname

Return the IPv4 address corresponding to the host name
Name:gethostbyname
Category:Network
Programming Language:php
One-line Description:Returns the IPv4 address of the given domain/hostname.

Definition and usage

gethostbyname() function returns the IPv4 address of the given domain/hostname.

Example

gethostbyname() example:

 <?php
$ip = gethostbyname ( "www.gitbox.net" ) ;
echo $ip ;
?>

grammar

 gethostbyname ( hostname )

Parameter value

parameter describe
hostname Required. Specify the host name (such as "http://www.gitbox.net").
Similar Functions
Popular Articles