Reply to Re: [PHP] Files passing through

Your name:

Reply:


Posted by "Richard Lynch" on 08/23/05 11:06

On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
> Kim Steinhaug (php list) wrote:
>> I'm using this method, works fine with 50mb+ files :
>>
>> if( $fd = fopen ($filepath, 'r')){
>> while(!feof($fd)) {
>> $buffer = fread($fd, 2048);
>> print $buffer;
>> }
>> fclose ($fd);
>> exit;
>> }
>
> Is there a reason why you assign the output of fread() to a variable
> and
> then print it? Why not just:
>
> print(fread($fd, 2048));
>
> which would be faster because it doesn't need to assign to a variable,
> wouldn't it? Maybe I'm missing something..

You're not missing anything, but a 2 K string buffer assignment/print
is probably not gonna save much...

Benchmark it both ways and see.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация