PHP 8.5.0 Beta 3 available for testing

Voting

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

The Note You're Voting On

cmr at forestfactory dot de
18 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