Function __global->get_ip_address

Definitions

sources/global3.php

  • Attempt to get the clean IP address of the current user.Note we do not consider potential proxying because that can easily be forged, and even if not it could be some local IP that is not unique enough.The software has support for deproxying in global.php, which will adjust REMOTE_ADDR well in advance of this function being called.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: string

Parameters

Name Type Default Set Range Description
$amount integer 4 N/A N/A The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled.
$ip ?IP Null N/A N/A IP address to use, normally left null (null: current user's)

Return

  • The users IP address (blank: could not find a valid one)
  • Type: IP
  • Set: N/A
  • Range: N/A