PHP

HOW to get visitor IP behind Cloudfare or Proxy

Normally we would use $_SERVER[‘REMOTE_ADDR’] but unfortunately, this doesn’t work with Cloudflare. This small PHP function will let you get the visitor’s real IP address, even if you use Cloudflare or if they’re hiding behind a proxy

Scroll to Top