End of a File
Wednesday June 14, 2006
When you are reading data from a file, you are often using a loop, reading one line of the file at a time. But how do you know when to stop and exit the loop? That is where feof () is used. Feof () checks to see if you are at the end of the file and returns a true or false. If the condition on your loop is !feof($yourfile) it will cycle until the entire file contents have been read and then stop.


No comments yet. Leave a Comment