New line or return being added to text file with out prompt
<p>first off I'm a noob to PHP but here is my problem. I am trying to read a line from a text file, manipulate the line then write the original and new line to a new text file. For some reason it adds an extra return or new line in the output file.</p>

<p><strong>Original File Text</strong></p>

<pre><code>/Volumes/EC/EC_0101/B-W Art/001_0101.EPS
...
/Volumes/EC/EC_0101/B-W Art/010_0101.EPS
</code></pre>

<p><strong>HTML Output for Testing</strong></p>

<pre><code>EC:EC_0101:B-W Art:001_0101.EPS EC EC_0101 B-W Art 001_0101.EPS
...
EC:EC_0101:B-W Art:010_0101.EPS EC EC_0101 B-W Art 010_0101.EPS
</code></pre>

<p><strong>New Text File Output</strong></p>

<pre><code>EC:EC_0101:B-W Art:001_0101.EPS
    EC  EC_0101 B-W Art 001_0101.EPS
...
EC:EC_0101:B-W Art:010_0101.EPS
    EC  EC_0101 B-W Art 010_0101.EPS
</code></pre>

<p><strong>Should be tab delimited</strong></p>

<pre><code>EC:EC_0101:B-W Art:001_0101.EPS EC  EC_0101 B-W Art 001_0101.EPS
...
EC:EC_0101:B-W Art:010_0101.EPS EC  EC_0101 B-W Art 010_0101.EPS
</code></pre>

<p><strong>My Code</strong></p>

<pre><code>$file = fopen("files_list.txt", "r") or exit("Unable to open file!");
$filename = "files_list_tab.txt";
//Output a line of the file until the end is reached
while(!feof($file))
  {
  $strLink = fgets($file);
  //$strComment = $strLink;

  $strLink= str_replace("/",":",$strLink);
  $strLink= str_replace(":Volumes:","",$strLink);
  $strComment= str_replace(":","\t",$strLink);

  $strCombined = $strLink."\t".$strComment;
  $array[] = $strCombined;

  echo $strCombined. "&lt;br&gt;";

  }
fclose($file);

echo "Done &lt;br&gt;";

$strCombined = $array;
file_put_contents($filename, $strCombined);
echo "Done &lt;br&gt;";
</code></pre>
