ExamVeda
Login
Home
This question belongs to PHP File System
File System
?

The ........... function is used to read a single character from a file.

Answer & Solution
Correct Answer: Option A
Option A: fgetc()
This function in PHP is used to read a single character from a file. It retrieves the next character from the file pointer and advances the file pointer position to the next character.

Option B: fgets()
The fgets() function is used to read a line from a file. It retrieves a line of text from the file pointer, including the newline character at the end of the line.

Option C: fget()
There is no fget() function in PHP related to file reading. This option is incorrect.

Option D: fgetf()
There is no fgetf() function in PHP related to file reading. This option is incorrect.

Conclusion:
The function used to read a single character from a file in PHP is fgetc() (Option A). This function is specifically designed to fetch individual characters from the file, making it the correct answer to the question.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.