Thanks, you're right. Now it works even using dll module (not CGI) version.
Anyway it is strange that the behavior of the fread function is conditioned
whether I use dll module or CGI...

Roland

"Mark" <[EMAIL PROTECTED]> píse v diskusním príspevku
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Fri, 12 Oct 2001 21:00:24 +0200, Roland Divin wrote:
>Hi,
>I can'r read binary file that contains '0x0' character. Reading
>process
>stops after reading '0x0' character on windows version of PHP. On
>Linux it
>does not.
>
>That same code gives another result on windows then on linux. Why?
>(Consider file text.txt is contaning '0x0' characters. I'm using
>PHP4 build
>from Jun 22 2001.)
>
>$filename = "text.txt";
>$fd = fopen ($filename, "r");

should be "rb" for binary files.

>$contents = fread ($fd, filesize ($filename));
>fclose ($fd);
>echo $contents;
>echo strlen($contents);
>for($i=0;$i<strlen($contents);$i++)
>{ echo "$i:".ord($contents[$i])."<br>"; }
>
>Isn't it bug?
>
>Thanks
>Roland Divin
>
>
>


--
Mark, [EMAIL PROTECTED] on 10/11/01





-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to