file_get_contents function allows you to keep text formatting tags. See also file_getss() function.

<?php
//file_get_contents.php
$path="r_tags_2.txt";
$handle = fopen($path, "r");
while (!feof($handle)) {
$buffer = fgetss($handle, 1400);
echo $buffer;
}
fclose($handle);
?>
<html>
<title> file_get_contents.php</title>
<body text="#000080" bgcolor="#F7F0D7">
<br>
<?php
echo "file size is: ".filesize($path) . ' bytes';
$localfile = file_get_contents("r_tags_2.txt");
echo "<br/>". $localfile;
?>
</body>
</html>