Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chaselivingston/ce0017a8b46435285c567a074d27747c to your computer and use it in GitHub Desktop.
Save chaselivingston/ce0017a8b46435285c567a074d27747c to your computer and use it in GitHub Desktop.
if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$forwarded_ips = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $forwarded_ips[0];
unset( $forwarded_ips );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment