|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-07-22 16:17 UTC] andy@php.net
[2001-07-22 16:17 UTC] andy@php.net
[2002-06-02 14:03 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 07:00:01 2025 UTC |
I've submitted this bug some days before but I didn't get very kind reply. I decided to resubmit it. test.php: <?php $fp = fopen("test.txt", "r"); $str = ""; while (!feof($fp)) $str .= fgets($fp, 64); fclose($fp); echo count(split("\n", $str))."<br />".count(split("\r\n", $str)); ?> And I've put 3 random lines in test.txt OK, my PHP is running as Apache module, so when I type "localhost/test.php", I got the output "3<br />1". Then, I run this script in CGI mode. This can be done simply by the command "c:\php_path\php.exe test.php", and I will get the output "3<br />3". OK, so PHP is not portable, even in the same platform but different PHP running mode. CGI PHP and module PHP interpret "\r\n" differently.