Definition :
The feof() function in PHP is an inbuilt function which is used to test for the end-of-file on a file pointer. It checks if the “end-of-file” has been reached or not. The feof() function is used for looping through the content of a file if the size of content is not known beforehand.
feof(file)
Parameter | Description |
---|---|
file | Required. Specifies an open file to check |
Given below example open file, read lines - until EOF is reached:
Output : hello this is a demo file