| Posted by countach on 09/20/07 12:55 
En las nuevas, vertigo escribiσ:> Hello
 >
 > <?php
 > $fh = fopen("/var/www/localhost/htdocs/web/webalizer.hist","r");
 > $line="";
 > while(!feof($fh)){
 >      $line=fgets($fh);
 >      print "$line<BR>";
 > }
 > print "LINE: $line<BR>";
 > fclose($fh);
 > ?
 >
 > Why i have such result that i co not see anything after "LINE:" ?
 > (is $line variable zeroed after while loop ? how can i prevent it ?)
 
 $line contents are overwriten each loop.
 
 Inside the loop you must do:
 a) $line .= fgets($fh).'<br>'; // NOTE DE DOT BEFORE DE EQUAL
 b) // REMOVE THE print statment.
 
 
 And that's all
 [Back to original message] |