开发者

Getting computer name, computer's Local ip and computer's server ip using php

How do I get computer name, computer's Local IP (if it is using LAN) and computer's server IP (LAN's Server IP) using P开发者_如何转开发HP.


Server IP: $_SERVER['SERVER_ADDR']

Computer name: You can't get that.

Local ip will be $_SERVER['REMOTE_ADDR'] if you are on a local server.

This is the list of available $_SERVER vars: http://php.net/manual/en/reserved.variables.server.php


I think they should all be in the $_SERVER superglobal.

All covered here: http://php.net/manual/en/reserved.variables.server.php


I use this one:

gethostbyaddr($_SERVER['REMOTE_ADDR'])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜