AbstractGeoIp
Abstract GeoIP
Attributes
- #[AllowDynamicProperties]
Table of Contents
Properties
| $ip_address |
Methods
| getCountryCode() | Returns the 2-character country code where the IP resides |
| getCountryName() | Returns the name of the country where the IP resides |
| getIp() | Returns the currently set IP address |
| getLocation() | Fetches an array of information about the location of the IP address, including longitude and latitude. |
| getOrganization() | Get the organization or ISP that owns the current IP address. Requires a premium database. |
| getRegion() | Get the region (e.g. state) of the given IP address. |
| setIp() | Sets the Ip address to use for all subsequent queries |
Methods
getCountryCode()
Returns the 2-character country code where the IP resides
public
abstract getCountryCode() : string
Return values
string —The 2-character country code where the IP resides
getCountryName()
Returns the name of the country where the IP resides
public
abstract getCountryName() : string
Return values
string —The name of the country where the IP resides
getIp()
Returns the currently set IP address
public
getIp() : string
Return values
string —The IP given in $ip, or the user's IP if $ip was null.
getLocation()
Fetches an array of information about the location of the IP address, including longitude and latitude.
public
abstract getLocation() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of information about the location of the IP address
getOrganization()
Get the organization or ISP that owns the current IP address. Requires a premium database.
public
abstract getOrganization() : string
Return values
string —The organization the IP address belongs to
getRegion()
Get the region (e.g. state) of the given IP address.
public
abstract getRegion() : string
Return values
string —The region the IP address resides in
setIp()
Sets the Ip address to use for all subsequent queries
public
setIp(string $ip) : mixed
Parameters
- $ip : string
-
The Ip address to set