How to use Filesystem feof in PHP

In this article I am going to explain about feof function in PHP.
  • 1011

PHP feof() function

The filesystem feof function is used to tests for end-of-file on an open file.

Syntax of feof function

feof(file)

Parameters in feof function

It has only one parameter:

Parameter Description
filename It specifies the open file to check.

Example of filesystem feof function

<html>

<body>

 

<?php

$file = fopen("C:\wamp\www\Dinesh\Mcn.txt", "r");

 

while(! feof($file))

  {

  echo fgets($file). "<br />";

  }

fclose($file);

?>

 

</body>

</html>

 

Output:

feof function.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.