/2.0/Tests/FileSystem/fgets.php

# · PHP · 15 lines · 14 code · 1 blank · 0 comment · 2 complexity · 3ed659d51c20619fb208366f26abc902 MD5 · raw file

  1. [expect php]
  2. [file]
  3. <?php
  4. include 'fs.inc';
  5. $handle = fopen("test.txt", "rt");
  6. if ($handle)
  7. {
  8. while (!feof($handle)) {
  9. $buffer = fgets($handle, 4096);
  10. echo htmlspecialchars($buffer);
  11. }
  12. fclose($handle);
  13. }
  14. ?>