Use fgets() to read a single line from a file


SUBMITTED BY: henry1874w

DATE: June 17, 2017, 1:39 p.m.

FORMAT: Text only

SIZE: 179 Bytes

HITS: 295

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. $myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");
  6. echo fgets($myfile);
  7. fclose($myfile);
  8. ?>
  9. </body>
  10. </html>

comments powered by Disqus