There was a wong answer and then there is the right answer:
$fp = fopen($file,"r"); while (!feof($fp)) { $line = fgets($fp, 4096); //gets one line at a time echo $line; // Or whatever else you want to do } fclose($fp);
HTH. Robert
If all the OP wants to do is echo out the file, then why not just use the file() function. Then each line is loaded up into an array element, and you've saved yourself a bit of cpu. And your example above doesn't address the OP's claim that it is not handling new lines. Course, without seeing his code, or having him explain the issue a bit better, all we're doing is spitting in the wind.
-- By-Tor.com It's all about the Rush http://www.by-tor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php