Prepare for your Next Interview
This is a discussion on IP address within the PHP forums, part of the Web Development category; I want to get ip address. How can I get it or what functions or methods can be used to get ip address using PHP Timmy...
|
|||
|
Re: IP address
You can use REMOTE_ADDR or REMOTE_HOST to achieve the above that is get ip address. But I want to know about super global variables in php. Someone throw highlight on this.
|
|
|||
|
baria Mahesh::
you will use this code for getting ip address which is given below:: <?php $ip = gethostbyname('www . example . com'); $out = "The following URLs are equivalent:<br />\n"; $out .= '[[siteurl]], http://' . $ip . '/, and http://' . sprintf("%u", ip2long($ip)) . "/<br />\n"; echo $out; ?> ip2long() function given to you ip address or particular given hostname. ![]() |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RAM Size in Solaris Server | blenda | Unix/Linux | 3 | 2 Weeks Ago 12:58 AM |