PHP code example of ip2location / ip2proxy-codeigniter4
1. Go to this page and download the library: Download ip2location/ip2proxy-codeigniter4 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ip2location / ip2proxy-codeigniter4 example snippets
// (ine('IP2PROXY_API_KEY', 'your_api_key');
// ( Define to use https or http.
define('IP2PROXY_USESSL', false);
$ipx = new IP2Proxy_lib();
print_r ($ipx->getWebService('1.0.241.135'));
// (define('IP2LOCATION_IO_API_KEY', 'your_api_key');
// (optional) Define Translation information. Refer to https://www.ip2location.io/ip2location-documentation for available languages.
define('IP2LOCATION_IO_LANGUAGE', 'zh-cn');
$ipl = new IP2Proxy_lib();
print_r ($ipl->getWebService('1.0.241.135'));