<?php if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0]; } else { $ip = $_SERVER['REMOTE_ADDR']; } echo "Your IP address is: ".$ip; ?>
^_^ 亲爱的客官,如果您觉得本文对您有好处,请移动你的鼠标点点下面的关注我,一起学习,一起分享.~ ^_^