i was wondering if there was a way to use PHP to get the ip address of a server...
like the DOS command ping, i could type 'ping http://www.google.com' and it would output the ip address of the server. is there a way to do this in PHP? thanks a lot,
DeathBlade
get server ip?
Moderator: General Moderators
Actually ping is not the right tool to do that... Since a hostname can resolve to multiple ip addreses... Anyway, for php you might want to look at http://www.php.net/gethostbynamel (read the user comments too).
-
Deathblade
- Forum Newbie
- Posts: 11
- Joined: Mon Oct 30, 2006 5:57 pm