Which one of the following function is capable of reading a file into a string variable?
A
file_contents()
B
file_get_contents()
C
file_content()
D
file_get_content()
Correct Answer: file_get_contents()
The function file_get_contents() reads a file into a string. This is the preferred way to read the contents of a file into a string as it will use memory mapping techniques.