read and write file with newline php
<p>I have a php file with the following info</p>

<pre><code>One
Two
Three
</code></pre>

<p>Now i want to split them into an array, so i used:</p>

<pre><code>   $filehandle = fopen($filename, 'rb');
  $line_of_text = fgets($filehandle);
  $array = explode("\n", $line_of_text);
</code></pre>

<p>But it is not working.</p>

<p>They are written in the file like this:</p>

<pre><code>    $filehandle = fopen($textfile, 'a');
    fputs($filehandle, $line . "\r\n");
    fclose($filehandle);
</code></pre>

<p>So how do i read them into an array?. </p>

<p>Thanks.</p>
