0
I have this code below, and a TXT file with all IP’s. In the code below you have to set the IP directly to get the location of it, however I need it to be automated, I have the Ip’s in a file called ip.txt, I needed to create a while, for etc so that the IP’s are read and with echo bring the result. I’ve tried some unsuccessful ways, could help me?
<?php
require 'vendor/autoload.php';
$gi =
geoip_open("/xxx/xxx/xxx/xxx/GeoLiteCity.dat",GEOIP_STANDARD);
echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
echo geoip_country_code_by_addr($gi, "201.210.254.45") . "\t" .
geoip_country_name_by_addr($gi, "201.210.254.45") . "\n";
echo geoip_country_code_by_addr($gi, "124.253.51.88") . "\t" .
geoip_country_name_by_addr($gi, "124.253.51.88") . "\n";
geoip_close($gi);
?>
How are the data in
.txt
?– Marcelo de Andrade
They got the Ips under each other, no other information, just the Ip’s.
– user54154
Sorry, I edited my text, in TXT there are no countries and acronyms, but only Ips.
– user54154