• $line = fgets($myfile,5000);

    This "gets" the first line of the $myfile file and assigns it to the variable $line.

    Each time the while loop comes back to this command, it will get the next line, and then the next line, and so on.

    The 5000 means that each line can be up to 5000 characters long.

  • print "$line <p>";

    Prints the text in each line of textthought.txt in a new paragraph as the script loops through them.

  • }

    This is the end marker for the while loop.

  • fclose($myfile);

    Once the while loop is finished, $myfile (the variable that stands for textthought.txt) is closed.

  1. In the browser, go to:

    www.yourwebsite.com/phplinks.html
  2. Click the 22. Display a text file link.

    The output should look something like this: