- file_get_contents: documentation ( source)
- explode: documentation ( source)
- trim: documentation ( source)
<?php
$filestring = file_get_contents('http://www.ipdeny.com/ipblocks/data/countries/cn.zone');
$filearray = explode("\n", $filestring);
while (list($var, $val) = each($filearray)) {
++$var;
$val = trim($val);
print "Line $var: $val<br />";
}