Get remote servers ip [part 2]

From: Date: Wed, 22 Sep 2004 12:34:16 +0000
Subject: Get remote servers ip [part 2]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-197554@lists.php.net to get a copy of this message
Hi again, Am having a bit of a problem here, basically I have a text box on my site where the visitor enters a url and I display that url's ip address...which as Eugeni kindly pointed out can be easily done with gethostbyname()...but the problem is the url entered at my site would be something like: http://google.com/index.html or http://www.google.com/something/more/index.html and gethostbyname is only displaying the ip if I pass it something like www.google.com Any idea how i can "strip" the first 2 examples to get the format i can pass to gethostbyname() ? Thanks, Mag ===== ------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail

« previous php.general (#197554) next »