Implementation of fgets() function in PHP
<p>I'm usinng Windows operating system and new to PHP.
Namely I'm trying to implement php function fgets() in php file:</p>

<pre><code>$file = fopen("$DOCUMENT_ROOT/Chapter02/test.txt","r");

while(! feof($file))
  {
  echo fgets($file). "&lt;br /&gt;";
  }

fclose($file);
</code></pre>

<p>I have created test.txt file with the following content: </p>

<blockquote>
  <p>Hello, this is a test file.<br>
  There are three lines here.<br>
  This is the last line. </p>
</blockquote>

<p>as example from <a href="http://www.w3schools.com/" rel="nofollow">http://www.w3schools.com/</a></p>

<p>Both files,  .php and .txt are located in a directory:</p>

<p>C:/wamp/www/Chapter02/</p>

<p>but after execution this php file, is not showing anything, and shall show:</p>

<blockquote>
  <p>Hello, this is a test file.<br>
  There are three lines here.<br>
  This is the last line. </p>
</blockquote>

<p>I suppose, I'm making a mistake in a path "$DOCUMENT_ROOT/Chapter02/test.txt", but I really don't know where the mistake is...</p>

<p>I would highly appreciate your help:)</p>

<p>kind regards,</p>

<p>Ivana </p>
