I'm writing a script that imports lines from a plain text file to a database.
Now all values are seperated by a newline, but not given by \n but given by ASCII values CR and LF(13 and 10).
So I wrote this script:
$file = 'file.txt';
echo ('<b>Import script</b><br/>');
$handle = fopen($file, 'r');
$n = 0;
$line = stream_get_line($handle, 4096, chr(13) . chr(10));
echo ('Line ' . $n . ': ' . $line . '<br/>');
But that gives everything back as just one
Line 1: Bla
What am I doing wrong?