PHP

PHP获取访客IP地址

PHP获取访客IP地址

赋值给变量ip <?php //获取访客IP if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP'];} elseif (!empty(…