PHP gethostbyaddr() Function

❮ PHP Network Reference

Example

A simple gethostbyaddr() example:

<?php
$host = gethostbyaddr($_SERVER["REMOTE_ADDR"]);
echo $host;
?>


Definition and Usage

The gethostbyaddr() function returns the domain name for a given IP address.

Syntax

gethostbyaddr(ipaddress)

Parameter Values

Parameter Description
ipaddress Required. Specifies an IP address

Technical Details

Return Value: The host name on success. The IP address or FALSE on failure.
PHP Version: 4.0+

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