|  | Posted by J.O. Aho on 12/27/05 12:29 
Curtis wrote:> When reading in text files, if the file has a blank line
 > following text, but no text, it is apparently being ignored
 > on a file() call:
 
 No, this ain't a file() issue but the way HTML works.
 
 change this
 > $lines = file($filename);
 > echo count($lines);
 
 to
 
 ?>
 <pre>
 <?PHP
 $lines = file($filename);
 echo count($lines);
 ?>
 </pre>
 <?PHP
 
 
 
 > A space in the last blank line makes the count correct.
 
 HTML don't respect linebreaks, you need to change those to <br> nl2br(9 can do
 that for your. Another way is to make the output between <pre></pre>.
 
 
 //Aho
  Navigation: [Reply to this message] |