Page 1 of 1

fread function problem

Posted: Sat Oct 17, 2009 4:23 am
by bealox
Hi guys

can anyone tell me why it doesn't show "filesize" data when I put

fread(txt file, filesize(path));

It only shows the content of the file.

Re: fread function problem

Posted: Sat Oct 17, 2009 7:31 am
by jackpf
Because you're using fread() maybe??

Need more info. Whole code?

Re: fread function problem

Posted: Sat Oct 17, 2009 7:40 am
by bealox
Hi jackpf

this is the code

$fp4= "$DOCUMENT_ROOT/orders/orders.txt.";
$content = fopen($fp4, "r");
echo fread($content, filesize($fp4));

Thanks

Re: fread function problem

Posted: Sat Oct 17, 2009 8:16 am
by jackpf
Well, if you just want the filesize, then there's no need to use fread().

Try just

Code: Select all

echo filesize($fp4);