Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parsing ip data from a file
$infile = 'austria.csv';
$outfile = 'austria.ips';
$fp = fopen($outfile,'w');
$handle = fopen($infile, "r");
if ($handle)
while (($line = fgets($handle)) !== false) {
$line = trim($line);
$a = explode(',',$line);
$from = str_replace('"','',$a[0]);
$to = str_replace('"','',$a[1]);
$ip = long2ip($i);
if(++$j % 10000==0)
echo ".";

This comment has been minimized.

Copy link

stefkes commented Dec 11, 2019

undefined variable $j


This comment has been minimized.

Copy link
Owner Author

chrisiaut commented Dec 15, 2019

undefined variable $j

that's okay since $j is just used to output the dots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.