Definition: The file () PHP function retrieves data from a file and puts it into an array. The array consists of the line number, and the data held in that line starting with 0. If your data isn't separated by new lines this may not return what you expect. If you are running an HTML file through file (), you should also use htmlspecialchars. If you want to return the data to a string instead of an array, you should use file_get_contents.
Examples:
<?php
$lines = file('YourFile.txt');
foreach ($lines as $line_num => $line)
{
print "<font color=red>Line #{$line_num}</font> : " . $line . "<br />\n";
//If you are reading HTML code use this line instead
//print "<font color=red>Line #{$line_num}</font> : " . htmlspecialchars($line) . "<br />\n";
}
?>

