The example code for PHP to obtain the IP of the client and server is as follows:
- echo "(1) The IP address of the user browsing the current page is: ";
- echo $_SERVER[REMOTE_ADDR];
- echo "
";
- echo "(2) The IP address of the user browsing the current page is: ";
- echo getenv(REMOTE_ADDR);
- echo "
";
- echo "The IP address of the host www.ite5e.com is :";
- echo gethostbyname(www.baidu.com);
- ?>
-
http://www.bkjia.com/PHPjc/486100.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486100.htmlTechArticlePHP The example code for obtaining the IP of the client and server is as follows: ?php echo "(1) Browse the current page The user's IP address is: "; echo $_SERVER[REMOTE_ADDR]; echo "br /"; echo "(2) When browsing...