Problem using PHP to open text file - blank spaces are removed
<p>I'm trying to open and process ASCII files using PHP, but am having problems. The problem 
is that the blank spaces are removed, which I don't want to have happen, since the files are fixed width.</p>

<p>The PHP script I used is this:</p>

<pre><code>$myFile = Test.SEG";
$file_handler = fopen ($myFile, r) or die ("Can't open SEG File.");
while (!feof($file_handler))
    {
    $dataline = fgets($file_handler);
    echo $dataline, "&lt;br /&gt;";
    }
</code></pre>

<p>I tried pasting samples of the original file in here, but the spaces were removed here as well!</p>

<p>At this stage I'm just building the script in steps, getting one step working at a time, but this is as far as I've gotten. I plan to use substr() on '$dataline' to pick out the fields I need.</p>

<p>Any suggestions on how to keep the spaces intact? Something tells me it's something to do  with encoding, but I don't know for sure.</p>

<p>Thanks!</p>
