I am trying to read in a text file line by line but it truncates the line to where all spaces get reduced to one space. Is there a way to read in a file without truncating extra spaces?
# read file
$myfile = fopen($target_file, "r") or die("Unable to open file!");
while(!feof($myfile)) {
# add line to array
$line[$linenum] = fgets($myfile, 100);
# display line
echo $line[$linenum] . "</br></br>";
# increment counter
$linenum = $linenum + 1;
}
` – rap-2-h Jul 19 '16 at 21:09