Remove new lines from data retrived from text file using PHP
<p>I have following data in text file </p>

<pre><code>375020222511963
284970411563422
290245594366931
</code></pre>

<p>I need to retrieve a random variable from the above text file.</p>

<p>I use the following php code to do that</p>

<pre><code>&lt;?php 
    $file = file("file.txt");
    $len = count($file);
    $rand  = rand ( 0, $len-1 );
    echo $file[$rand];
?&gt;
</code></pre>

<p>But it's returning new line along with the retrieved data. I need to retrieve data without new line.</p>
