As you know, the user's IP is $_SERVER['REMOTE_ADDR']. That's it. But in some situations a server may be behind a proxy (often a load balancer), then IP will be in $_SERVER['HTTP_X_FORWARDED_FOR']. Also it's recommended to store both values.
Ok I've two related questions:
REMOTE_ADDRis containing what when thisHTTP_X_FORWARDED_FORisn't empty?What are these things(based on this answer) ? Might they be containing the IP? If yes then in that case
REMOTE_ADDRandHTTP_X_FORWARDED_FORare containing what?HTTP_CLIENT_IPHTTP_X_FORWARDEDHTTP_FORWARDED_FORHTTP_FORWARDED