Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
snippets:php:fgets [26-Jan-2021 19:51] Steve Joyntsnippets:php:fgets [02-Feb-2025 16:14] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 $filename = 'whatever'; $filename = 'whatever';
 + 
 $fh = @fopen($filename, 'r'); $fh = @fopen($filename, 'r');
  
 if ( ! $fh ) { if ( ! $fh ) {
-    throw new exception("Failed to open ${filename}";+    throw new Exception("Failed to open ${filename}");
 } }
  
Line 12: Line 12:
     echo $text;     echo $text;
 } }
- 
-fclose($fh); 
- 
  
 </file> </file>
  • snippets/php/fgets.1611690701.txt.gz
  • Last modified: 02-Feb-2025 16:12
  • (external edit)