I\'m trying to open a text file and output its contents with the code below. The text file includes line breaks but when I echo the file its unformatted. How do I fix this?<
Are you outputting to HTML or plain text? If HTML try adding a at the end of each line. e.g.
while (!feof($handle)) { $buffer = fgets($handle, 4096); // Read a line. echo "$buffer"; }