Home >Web Front-end >JS Tutorial >Detailed explanation of php gethostbyname function to obtain domain name IP address_javascript skills
Returns the IP address.
gethostbyname syntax: string gethostbyname(string hostname);
gethostbyname return value: string
Function type: network system
gethostbyname content description
This function can return a machine name (Domain Name) IP address (IP Address). If the execution fails, the original machine name is returned.
Usage Example
The return value of gethostbyname in the following example is 61.129.70.67
echo gethostbyaddr("www.jb51.net");
?>
The following is the specific usage code: