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
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name inside a function in PHP ?
- How to get the function name from within that function using JavaScript ?
- PHP | Ds\Set contains() Function
- D3.js | d3.map.get() Function
- p5.js | min() function
- p5.js | hue() function
- p5.js | nf() Function
- CSS | rgb() Function
- D3.js | d3.hcl() Function
- PHP | Ds\Set last() Function
- PHP | Ds\Set first() Function
- D3.js | d3.set.add() Function
- p5.js | cos() function
- p5.js | red() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


