This is a really simple question that I've wondered for a while now...

what is the best way to read a file?  There are so many different 
functions for reading files that I have no idea which I should use.

readfile() returns its values to standard output -- I don't want to use 
this, since my script needs to load the data in the file into a variable 
(it's a .xsl file).  fgets() looks like it could work if I made an array 
out of each line read and then imploded them.  fread() looks like the 
'main' function for reading from files.  fpassthru() -- I guess if 
you're already in the middle of a file it's a good way to finish?

There are other functions for reading files, but they are less 
ambiguous, with purposes like reading from sockets or certain kinds of 
files.  I'm not interested in those -- I just want to know which 
function I should use to simply read a file and store the file's 
contents in a variable (for later actions to be performed on/with this 
variable).

Thank you.


Erik





----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to