• PHP Video Tutorials

PHP - Function gethostbynamel



Syntax

array gethostbynamel ( string $hostname )

Definition and Usage

It is used to get a list of the IPV4 addresses which has given by Host name

Return Values

It will return an array of IPV4 address or FALSE if hostname could not be resolved.

Parameters

Sr.No Parameters & Description
1

hostname

It gives the corresponding host name

Example

Try out following example

<?php
   $hosts = gethostbynamel('www.tutorialspoint.com');
   
   print_r($hosts);
?>

Above Example gives the result as follows

Array ( [0] => 117.18.237.42 )
php_function_reference.htm
Advertisements