PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How to find a domain name for an IP address?


If you have an IP address then sometimes it will be useful to try to resolve the host domain name for that IP address.

To do this is easy in PHP as there is a built in function that accepts the IP address and will find the host name for you.

In order to do this, code like the below will help:

<?php
$ip 
$REMOTE_ADDR;//capture IP
$domain GetHostByName($ip);
?>


The variable $domain will now contain the hostname.



Comment on this Question and Answer >>>

ASK A QUESTION

More website PHP Questions

where do i go to paste my google adsense code?

What is a .htaccess file?

What is this form of code for a website? http://www.virginamerica.com/va/home.do the drop down menu's. whats the name for that. im trying to incorporate it into my design, but dont no the name for it.

How do I keep my site menu in one file?

I would like to browse to a url eg http://mysite.com/index.html and dump the content of that site in a variable eg $htmlDump?



Custom Search