gethostbyaddr

(PHP 4, PHP 5, PHP 7, PHP 8)

gethostbyaddr 获取指定 IP 地址对应的 Internet 主机名

说明

gethostbyaddr(string $ip): string|false

返回由 ip 指定的 Internet 主机名。

参数

ip

主机 IP 地址。

返回值

成功则返回主机名,失败时返回未修改的 ip,输入错误时返回 false

范例

示例 #1 gethostbyaddr() 的简单例子

<?php
$hostname
= gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo
$hostname;
?>

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top