note 99507 deleted from function.header by danbrown
| From: | danbrown@php.net | Date: | Fri, 20 Aug 2010 18:01:06 +0000 |
| Subject: | note 99507 deleted from function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171893@lists.php.net to get a copy of this message | ||
Note Submitter: fgif2 at yahoo dot fr
----
About Cody G.'s research:
Thanks a lot for your findings. I only wanted to add that it's not the more efficient way to
use an include() function for the only purpose to output the content of a file.
As it's well described and documented for example in this webpage: http://www.raditha.com/wiki/Readfile_vs_include
, the readfile() function - or if you prefer, the fpassthru() function, but this one asks you to
wrap it by the opening and the closing of the file - is way faster, and uses a lot less memory, as
it only asks to the server to make what is its job, after all: to output a text file.
This way the content is not loaded into the php program memory, and the sending is managed by the
http server which has been highly optimized for this simple task.
(I apologize if my participation is seen as out of the subject strictly relative to the header()
function).