AV1611 Posted June 12, 2006 Share Posted June 12, 2006 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... Link to comment https://forums.phpfreaks.com/topic/11775-maybe-easy-maybe-hard/ Share on other sites More sharing options...
kenrbnsn Posted June 12, 2006 Share Posted June 12, 2006 Take a look at the [a href=\"http://www.php.net/gethostbyname\" target=\"_blank\"]gethostbyname()[/a] function.Ken Link to comment https://forums.phpfreaks.com/topic/11775-maybe-easy-maybe-hard/#findComment-44577 Share on other sites More sharing options...
joquius Posted June 12, 2006 Share Posted June 12, 2006 from php.netExample 1. A simple gethostbyname() example[code]<?php$ip = gethostbyname('www.example.com');echo $ip;?> [/code] Link to comment https://forums.phpfreaks.com/topic/11775-maybe-easy-maybe-hard/#findComment-44579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.