PHP gethostbynamel() Function

❮ PHP Network Reference

Example

A gethostbynamel() example:

<?php
$hostlist = gethostbynamel("www.w3schools.com");
print_r($hostlist);
?>


Definition and Usage

The gethostbynamel() function returns a list of IPv4 address for a given domain/host name.

Syntax

gethostbynamel(hostname)

Parameter Values

Parameter Description
hostname Required. Specifies a hostname (like "www.w3schools.com")

Technical Details

Return Value: An array of IPv4 address on success. FALSE on failure.
PHP Version: 4.0+

❮ PHP Network Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.