#11961 [Com]: \r\n or \n
| From: | download-video778 at hotmail dot com | Date: | Tue, 20 Jul 2004 15:09:02 +0000 |
| Subject: | #11961 [Com]: \r\n or \n | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-63022@lists.php.net to get a copy of this message | ||
ID: 11961
Comment by: download-video778 at hotmail dot com
Reported By: wuxinan at 263 dot net
Status: Bogus
Bug Type: Strings related
Operating System: Win98 SE
PHP Version: 4.0.6
New Comment:
<a href=http://advanced-private-cu.da.ru>video
download</a>
Previous Comments:
------------------------------------------------------------------------
[2002-06-02 14:03:32] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
------------------------------------------------------------------------
[2001-07-22 16:17:59] andy@php.net
reclassified
------------------------------------------------------------------------
[2001-07-22 16:17:51] andy@php.net
reclassified
------------------------------------------------------------------------
[2001-07-08 18:45:59] wuxinan at 263 dot net
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11961&edit=1