PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/2.0/Tests/FileSystem/fread.php

#
PHP | 13 lines | 11 code | 1 blank | 1 comment | 0 complexity | 06a9a3426372475a8e35d90746918fb4 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. // get contents of a file into a string
  6. echo "[BIN]";
  7. $filename = "test.dat";
  8. $handle = fopen($filename, "rb");
  9. $contents = fread($handle, filesize($filename));
  10. fclose($handle);
  11. echo strlen($contents);
  12. ?>