Cannot output the same data from text file in PHP

From: Date: Thu, 14 May 2009 09:19:12 +0000
Subject: Cannot output the same data from text file in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-292562@lists.php.net to get a copy of this message
Hi Folks, I have a written a script in PHP which outputs the result from a text file. The PHP script is as follows: <?php $alldata = file("result.txt"); echo "<table><tr><td>"; foreach($alldata as $line_num => $line) { echo $line."<br>"; } echo"</td></tr></table>"; ?> I have attached the result.txt file. However the output of the script is as follows: Query: 1 atggcaatcgtttcagcagaaaaattcgtaattcgagctcgcccggggatcgatcctcta 60 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Sbjct: 1 atggcaatcgtttcagcagaaaaattcgtaattcgagctcgcccggggatcgatcctcta 60 which is not exactly as in the result.txt file in that the pipelines are displaced. Any pointer to this problem shall be appreciated. Thanking you in advance. Moses

Query: 1 atggcaatcgtttcagcagaaaaattcgtaattcgagctcgcccggggatcgatcctcta 60 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Sbjct: 1 atggcaatcgtttcagcagaaaaattcgtaattcgagctcgcccggggatcgatcctcta 60
« previous php.general (#292562) next »