Friday, October 24, 2025
HomeLanguagesPHP | gethostnamel() Function

PHP | gethostnamel() Function

The gethostbynamel() function is an inbuilt function in PHP which returns a list of IPv4 address for a specified internet host/domain name.

Syntax:

gethostbynamel( string $hostname )

Parameters: This function accepts single parameter $hostname which is required. It specifies the hostname whose IPv4 address list to be found.

Return Value: This function returns the list of IPv4 address of the specified host/domain name on success or FALSE on failure.

Note: This function is available for PHP 4.0.0 and newer version.

Below program illustrates the gethostbynamel() function in PHP:

Program:




<?php
$hostlist = gethostbynamel("geeksforgeeks.org");
print_r($hostlist);
?>


Output:

Array ( [0] => 52.25.109.230 )

Reference: https://www.php.net/manual/en/function.gethostbynamel.php

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS