PageRenderTime 46ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/2.0/Tests/FileSystem/fgets.php

#
PHP | 15 lines | 14 code | 1 blank | 0 comment | 2 complexity | 3ed659d51c20619fb208366f26abc902 MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
  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. ?>