PHP: Need help removing line break from code
<p>I am trying to get names from a .txt file. I am using file('filename.txt') but if i use a php for loop to try and trim the names, it comes out on multiple lines:</p>

<p>This is the actual line that prints the javascript (NOTE: I am going to be putting these names into a select box, if you can fix the problem at hand the rest of the code should work so unless you a big problem with it you don't need to comment)</p>

<pre><code>&lt;?php
for($i=1; $i &lt; 27; $i++){
  echo "selbox.options[selbox.options.length] = new Option('".lines[$i]."','".$lines[$i]."');\n";
}
?&gt;
</code></pre>

<p>Heres how it comes out on the browser:</p>

<pre><code>selbox.options[selbox.options.length] = new Option('Djamal ABDOUN
','First1 Last1
');
selbox.options[selbox.options.length] = new Option('Chadli AMRI
','First2 Last2
');
</code></pre>

<p>I need those to be on one line so i dont get a unterminated string literal js error
Any ideas on what i can do here?</p>

<p>EDIT: Oh i should probably mention, the $lines var is initiated like this:
$lines = file('filename.txt');
and inside that file i have formatted like this
First1 Last1
First2 Last2
First3 Last3 
etc. and i hit delete after each Last name until the next first name is touching, then hit enter to put it on a new line (Editor is notepad++)</p>
