Jump to content

Archived

This topic is now archived and is closed to further replies.

AV1611

maybe easy, maybe hard...

Recommended Posts

Question:

Is there a way in PHP to enter a url and get an IP back?

IE, if I enter www.google.com, I get back 1.2.3.4 or whatever...

Or, does that require rwhois or simular?

I just want to log what IP i'm on (I have dynamic ip) when I do a certain function...

Share this post


Link to post
Share on other sites
Take a look at the [a href=\"http://www.php.net/gethostbyname\" target=\"_blank\"]gethostbyname()[/a] function.

Ken

Share this post


Link to post
Share on other sites
from php.net

Example 1. A simple gethostbyname() example
[code]
<?php
$ip = gethostbyname('www.example.com');

echo $ip;
?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.