/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
- [expect php]
- [file]
-
- <?php
- include 'fs.inc';
- $handle = fopen("test.txt", "rt");
- if ($handle)
- {
- while (!feof($handle)) {
- $buffer = fgets($handle, 4096);
- echo htmlspecialchars($buffer);
- }
- fclose($handle);
- }
- ?>