[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/ -> functions-geo.php (summary)

Function relative to the geolocation functions (ip <-> country <-> flags), currently tied to Maxmind's GeoIP but this should evolve to become more pluggable

File Size: 153 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 functions

  yourls_geo_ip_to_countrycode()
  yourls_geo_countrycode_to_countryname()
  yourls_geo_get_flag()

Functions
Functions that are not part of a class:

yourls_geo_ip_to_countrycode( $ip = '', $default = '' )   X-Ref
Converts an IP to a 2 letter country code, using GeoIP database if available in includes/geo/

since: 1.4
param: string $ip      IP or, if empty string, will be current user IP
param: string $default Default string to return if IP doesn't resolve to a country (malformed, private IP...)
return: string 2 letter country code (eg 'US') or $default

yourls_geo_countrycode_to_countryname( $code )   X-Ref
Converts a 2 letter country code to long name (ie AU -> Australia)

This associative array is the one used by MaxMind internal functions, it may differ from other lists (eg "A1" does
not universally stand for "Anon proxy")

since: 1.4
param: string $code 2 letter country code, eg 'FR'
return: string Country long name (eg 'France') or an empty string if not found

yourls_geo_get_flag( $code )   X-Ref
Return flag URL from 2 letter country code

param: string $code
return: string



Generated: Sat Oct 1 05:10:01 2022 Cross-referenced by PHPXref 0.7.1