I put together an example php script that reads and extracts data from IP To Country so it can be utilized however you wish.
<?php
// Your comma-separated list of ip addresses or a single ip
$ip_list = "74.53.231.66,210.213.161.50,219.165.209.190,24.55.94.84";
// The webpage to query
$the_source_page = "http://jasonlau.biz/ip2country/$ip_list";
if(!$get_source_page = @file($the_source_page))
{
$error = "yes";
echo "An error occurred at line 8 and the request was terminated.\n";
exit;
} else {
// Get the HTML to a string
$source_page_html = implode('', $get_source_page);
// Narrow down the HTML to only the section we need
$desired_section = explode("IP 2 Country Output",$source_page_html);
// If no desired section is found return error
if(empty($desired_section[1]))
{
$error = "yes";
echo "An error occurred at line 18 and the request was terminated.\n";
exit;
} else {
// Get the unordered lists from the HTML
$lists = explode("<ul",$desired_section[1]);
// Get the list items from the lists
$items = explode("<li>",$lists[1]);
array_shift($items);
foreach($items as $info){
// Use the comma as the key for each item part
$parts = explode(",",$info);
$original_ip = $parts[0];
$ipv4 = $parts[1];
$country_code1 = $parts[2];
$country_code2 = $parts[3];
$country_name1 = $parts[4];
$country_name2 = $parts[5];
$country_name3 = $parts[6];
$flag_url = $parts[7];
$flag_html = $parts[8];
/*
// just a thought -
// print the parts for each item
foreach($parts as $part){
echo "$part<br>\n";
}
*/
echo "IP: $original_ip<br>\n";
echo "IPv4: $ipv4<br>\n";
echo "CC 1: $country_code1<br>\n";
echo "CC 2:$country_code2<br>\n";
echo "CN 1: $country_name1<br>\n";
echo "CN 2 $country_name2<br>\n";
echo "CN 3 $country_name3<br>\n";
echo "Flag URL: $flag_url<br>\n";
echo "Flag: $flag_html<br><br>\n";
}
}
}
?>
I've attached a text file to this post that contains this code. Also, I have thrown in a few test IP addresses for the demonstration.