Category Archives: PHP – File Read: gets Function

PHP – File Read: gets Function

The fgets() filesystem function in PHP will return a line from your target file handler. This function can take up to two parameters. The first parameter is your file handler. The second parameter is the character length you wish to read into the line. If no second parameter is supplied it will read until the end of the line.

Code

OUTPUT

Returns 9 character from the file