for($i=1;$i<=$n;$i++){ $line=fgets($rhandler,85); if($line==feof){echo 'fuck'; exit;} $line=trim($line); } How to do an IF END OF FILE? please not that i don't want to use the while(!eof... thing...
fseek() is what you are looking for.. you can specify "seek_end". http://us3.php.net/manual/en/function.fseek.php