Open In App

PHP | gethostbyaddr() function

The gethostbyaddr() function is an inbuilt function in PHP which returns domain name for a specified IP address.

Syntax:



gethostbyaddr($ip_address);

Parameter: This function accepts one parameter as mentioned above and described below:

Return Value:



Note:

Example




<?php
$host = gethostbyaddr("52.25.109.230");
echo $host;
?>

Output:

ec2-52-25-109-230.us-west-2.compute.amazonaws.com

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

Article Tags :