September 2001
Intermediate to advanced
768 pages
32h 45m
English
string fgets(resource file_handle, int bytes)
Reads a line from a file.
Returns:
Current line; FALSE on error
Description:
fgets() is similar to fgetc() except that it returns a line of text from the file pointer of a length specified by the number of bytes. If a newline or EOF occurs before the number of bytes specified is read, fgets() returns the bytes read up to this point. This can be extremely useful when reading and processing lines of text from a file, pipe, or socket.
Warning:
Because some of the filesystem functions to read/write from files partially share the same code, one or more of the bugs reported elsewhere may also apply to this function.
3.0.6: Function not binary-safe.
3.0.11: Will not return when using non-blocking ...
Read now
Unlock full access