RosettaCodeData/Task/Input-loop/PHP/input-loop-1.php

9 lines
176 B
PHP
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
$fh = fopen($filename, 'r');
if ($fh) {
while (!feof($fh)) {
$line = rtrim(fgets($fh)); # removes trailing newline
# process $line
}
fclose($fh);
}