1.

Which one of the following function is capable of reading a specific number of characters from a file?(a) fgets()(b) fget()(c) fileget()(d) filegets()The question was asked in a national level competition.The origin of the question is File System and PHP in portion File and Session Handling in PHP of PHP

Answer»

Correct choice is (a) FGETS()

EASY explanation: The function fgets() will return a line from an open file. This stops returning on a NEW line, at the specified length, or at EOF, whichever comes first.Its prototype is string fgets(resource handle [, int length]). If the optional length PARAMETER is omitted, 1024 character is assumed.



Discussion

No Comment Found

Related InterviewSolutions