Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
snippets:php:fgets [26-Jan-2021 19:39] – Steve Joynt | snippets:php:fgets [02-Feb-2025 16:14] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | < |
+ | $filename = ' | ||
+ | |||
+ | $fh = @fopen($filename, | ||
+ | if ( ! $fh ) { | ||
+ | throw new Exception(" | ||
+ | } | ||
+ | |||
+ | while ( ( $text = fgets($fh) ) !== false ) { | ||
+ | echo $text; | ||
+ | } | ||
</ | </ |