title: PHP - while loop (!feof()) isn't outputting/showing everything
body: <p>I am trying to read (and echo) <strong>everything</strong> of a .txt-File.</p>
  
  <p>This is my code:</p>
  
  <pre><code>$handle = @fopen("item_sets.txt", "r");
  
  while (!feof($handle))
  {
      $buffer = fgets($handle, 4096);
      $trimmed = trim($buffer);
      echo $trimmed;
  }
  </code></pre>
  
  <p>This is my "item_sets.txt": <a href="http://pastebin.com/sxapZGuW" rel="nofollow">http://pastebin.com/sxapZGuW</a></p>
  
  <p>But it doesn't echo everything (and changing how much it shows depending on if and how many characters i echo after it). <code>var_dump()</code> shows me that the last string is never finished printing out. That looks like this: </p>
  
  <p><code>" string(45) ""[cu_well_tra</code>. But if I put an</p>
  
  <p><code>echo "whateverthisisjustarandomstringwithseveralcharacters";</code>, </p>
  
  <p>my last output lines look like this: </p>
  
  <p><code>" string(45) ""[cu_well_traveled_ak47]weapon_ak47" "1"
  " string(5) "}
  "</code></p>
  
  <p>Basically my code isn't printing/echoing all of what it should or at least not showing it.</p>
  
  <p>Thanks in advance :) </p>