- substr: documentation ( source)
- strpos: documentation ( source)
- fclose: documentation ( source)
- fgets: documentation ( source)
- fwrite: documentation ( source)
- fopen: documentation ( source)
<?php
$input = fopen("http://www.white-bullet.com/domain-data.txt", "r");
$output = fopen("php://stdout", "w+");
if ($input) {
while (($line = fgets($input))) {
fwrite(
$output, substr($line, 0, strpos($line, " ")));
fwrite($output, "\n");
}
fclose($input);
fclose($output);
}
?>