+ 8
What is the difference between file () and fread()?
I suppose the open a file using fopen([name],r) and fread to access its contents works as well. so what is the difference to file([name])? And why these two ways?
1 Answer
+ 1
file reads the whole of the file into an array. fread will read up to a set byte length. with file, each line is an array key; knowing which lines you need, you can print those lines. Or, you can loopthe pointer and print the whole of the document.