How will you read a file in php?

i have a text file with this information in my server:

Data1
Data2
Data3
.
.
.
DataN

How do i read all the info from the text file (line by line) using PHP ?

PHP Php read
  • 0
  • 0

Answers ( 1 )

  1. Once a file is opened using fopen() function it can be read with a function called fread(). This function requires two arguments. These must be the file pointer and the length of the file expressed in bytes.

    
      // echo($line);
    }
    fclose($fh);
    ?>
    

    • 0
    • 0

    Login to comment

Give an Answer

Login to answer