I'm opening a TXT file in PHP and want to read the lines of it one by one.
I'm using fgets()
.
The problem is that the output is ignoring the tabulations ("\t") in the original file, which is not what I want.
There is some way to force PHP to don't ignore 'em?
My code:
$file = fopen("file.txt", "r") or die("<br><br>Error.");
while (!feof($file)) {
$string = fgets($file, 4096);
echo "<br> " . $string;
}