title: Detect a newline character
body: <p>the following is part of myfunction which opens a file and places the pointer at the end. It then tests each character <code>$char</code> in reverse order until it finds a newline or a carriage return character.</p>
  
  <p>The problem is it is not recognising these characters.</p>
  
  <p>The function is as follows:</p>
  
  <pre><code>while(count($results) &lt; $limit &amp;&amp; fseek($this-&gt;_pointer, $offset, SEEK_END) &gt;= 0) {
      $char = fgetc($this-&gt;_pointer);
      if($char == '\n' || $char == '\r'){
          print("YAY");
          $offset --;
          $data = $this-&gt;explodeData(fgets($this-&gt;_pointer, 1024));
          array_push($results, $this-&gt;formatRow($data));
      }
      $offset--;
  }
  </code></pre>
  
  <p>It never manages to <code>print("YAY")</code> however it is successfully testing each character. The file it is reading definitely has newlines in it.
  (The file was created by another function and has had <code>"\n"</code> inserted in it, this is showing inside it and is showing in my IDE successfully as being on alternate lines).</p>
  
  <p>Does anyone know why it is unable to recognise these newline characters?</p>