Problem Statement
Differentiate between fread and file_get_contents.
Explanation
fread requires a file handle and reads data in chunks, while file_get_contents reads the entire file directly. fread is suitable for large files or streaming, whereas file_get_contents is best for small files.
Code Solution
SolutionRead Only
fread($handle, filesize('data.txt'));