Most reference books/posts/documentation/etc. recommend using include() or require() to add, say, a common header to multiple php pages.
What's wrong with using readfile()?
Thanks, Ruth
include/require vs. readfile
Moderator: General Moderators
I guess the authors know more than us, but taking a quick glance at readfile's documentation:
Description
int readfile ( string filename [, int use_include_path])
Reads a file and writes it to the output buffer.
Returns the number of bytes read from the file.
We see that readfile also returns filesize, which we usually don't need, therefore becoming slower than include. But I bet there's more to it.
Description
int readfile ( string filename [, int use_include_path])
Reads a file and writes it to the output buffer.
Returns the number of bytes read from the file.
We see that readfile also returns filesize, which we usually don't need, therefore becoming slower than include. But I bet there's more to it.
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact: