(1).REMOTE_ADDR: The ip address of the user's computer browsing the current page
(2).HTTP_X_FORWARDED_FOR: The gateway of the user's computer browsing the current page
(3).HTTP_CLIENT_IP: Client's ip
Use $_SERVER["REMOTE_ADDR"] in PHP to get the client's IP address. However, if the client uses a proxy server to access, what you get is the IP address of the proxy server, not the real one. Client IP address. To obtain the client's real IP address through a proxy server, use $_SERVER["HTTP_X_FORWARDED_FOR"] to read it.
However, something to note is that not every proxy server can use $_SERVER["HTTP_X_FORWARDED_FOR"] to read the real IP of the client. Some of the IPs read by this method are still the IP of the proxy server. .
Another thing to note is that if the client does not access through a proxy server, the value obtained with $_SERVER["HTTP_X_FORWARDED_FOR"] will be empty.