|
Posted by Ridge Burner on 08/03/05 16:51
I have a text file with the following lines:
line1
line2
line3
line4
line5
And the following script:
<?
$line = file("builder2.txt");
foreach($line as $field){
rtrim($field, "\n\r");
echo "'".$field."', ";
}
?>
which returns:
'line1 ', 'line2 ', 'line3 ', 'line4 ', 'line5',
when it should return:
'line1', 'line2', 'line3', 'line4', 'line5',
I've tried using the ASCII references also, without effect.
I cannot seem to strip the newline off!
Any help would be appreciated!
--Ridge
Navigation:
[Reply to this message]
|