[go: up one dir, main page]

Voting

: min(four, nine)?
(Example: nine)

The Note You're Voting On

cmr at forestfactory dot de
17 years ago
Here's solution 3:

<?
$fp = fopen("myfile.txt", "r");
while ( ($current_line = fgets($fp)) !== false ) {
// do stuff to the current line here
}
fclose($fp);
?>

AFAICS fgets() never returns an empty string, so we can also write:

<?
$fp = fopen("myfile.txt", "r");
while ( $current_line = fgets($fp) ) {
// do stuff to the current line here
}
fclose($fp);
?>

<< Back to user notes page

To Top