Guest User

Untitled

a guest
Sep 29th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. <?
  2. $fp = fopen("file.txt", "r");
  3.  
  4. if ($fp) {
  5.  
  6. while (($buffer = fgets($fp, 4096)) !== false) {
  7. echo $buffer;
  8. }
  9.  
  10. if (!feof($fp)) {
  11. echo "Error: unexpected fgets() fail\n";
  12. }
  13.  
  14. fclose($fp);
  15.  
  16. } else {
  17.  
  18. echo "file access error";
  19.  
  20. }
  21.  
  22. ?>
Add Comment
Please, Sign In to add comment