🔷
PHP
The Javascript library of the API.
- php: >=7.4
composer require gre/geoip
include_once './vendor/autoload.php';
// Using the library
use GRE\GeoIP\GeoIP;
// Declaring the library's class
$GREGeoIP = new GeoIP();
The
$GREGeoIP
variable will be used to call the API methods and functions.Before we can use the methods of this library we have to set our
API Key
. This can be done by calling the setKey
function:$GREGeoIP->setKey('<API-Key>');
DO NOT forget to change the
<API-Key>
with your own API Key
.
If you don't have one, please take a look at the Quick Start page.After importing and defining the package you're ready now to use all it's functionalities. The library is consist or 2 main methods.
Last modified 2mo ago