Re: OPTIMIZING - The fastest way to open and show a file
| From: | Chris Shiflett | Date: | Sat, 15 Oct 2005 09:58:22 +0000 |
| Subject: | Re: OPTIMIZING - The fastest way to open and show a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224178@lists.php.net to get a copy of this message | ||
Ruben Rubio Rey wrote:
$handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); echo $contents;Replace this with: readfile($filename); It's faster for both you and PHP. Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/