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