Copy code The code is as follows:
function get_client_ip()
{
if ($_SERVER ['REMOTE_ADDR']) {
$cip = $_SERVER['REMOTE_ADDR'];
} elseif (getenv("REMOTE_ADDR")) {
$cip = getenv("REMOTE_ADDR");
} elseif (getenv("HTTP_CLIENT_IP")) {
$cip = getenv("HTTP_CLIENT_IP");
} else {
$cip = "unknown";
}
return $ cip;
}
echo "Your IP address is:".get_client_ip();
?>
http://www.bkjia.com/PHPjc/327832.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327832.htmlTechArticleCopy the code as follows: ? function get_client_ip() { if ($_SERVER['REMOTE_ADDR']) { $cip = $_SERVER['REMOTE_ADDR']; } elseif (getenv("REMOTE_ADDR")) { $cip = getenv("REMOTE_ADDR...