Problem is that even though I have put \n for new line characters, when I read the file back it always comes back as one line.
I have tried using fgets and fgetss to read it back and even though the PHP manual says length is not required for fgets it gives and a warning and then displays both writes as one line.
Code: Select all
$filename = "e;currencies.txt"e;;
$fp2 = fopen( $filename, "e;w"e; );
$rec = 'USD='.$usd.'\n';
fwrite( $fp2, $rec, strlen($rec));
$rec = 'EUR='.$eur.'\n';
fwrite( $fp2, $rec, strlen($rec));
fclose( $fp2 );Code: Select all
$filename = "e;currencies.txt"e;;
$fp3 = fopen( $filename, "e;r"e; );
$rec = fgets($fp3);
echo '<br />currencies<br />';
echo $rec;
fclose( $fp3 );looking at the created file shows both rows on one line like this:
USD=1.2985\nEUR=0.68540\n
Why?
tia