Resolve IP to Hostname using PHP

后端 未结 4 1685
天涯浪人
天涯浪人 2021-01-05 05:30

How can I resolve an IP address to a hostname using PHP?

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 05:51

    You can use the gethostbyaddr() function.

    $hostname = gethostbyaddr($ipAddress);
    

提交回复
热议问题