ID: 16714
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP Pro
PHP Version: 4.2.0
New Comment:
You can just use \n for that. Or open the script as binary. (PHP
translates \r\n on Windows to \n, unless you've opened the file as
binary)
Previous Comments:
------------------------------------------------------------------------
[2002-04-20 14:34:48] [EMAIL PROTECTED]
Hello,
I just installed PHP4.2.0 RC4 on my System using IIS 5.1 with all
patches. I installed PHP as ISAPI module, I ran before PHP 4.1.2 as CGI
where the following worked correctly:
A propgram running in background saves every 10 secons the actual
traffic into a file "jetzt.log", each line is separeted with a carraige
return and a line feed "\r\n" - like any other textfile under windows.
For example it looks as the following:
34.865
9.763
0 Tage 1 Stunden 9 Minuten 41 Sekunden
16
And here is my script:
<?
$fp = fopen("jetzt.log","r");
$file = fread($fp, filesize ("jetzt.log"));
fclose($fp);
$haufen = explode("\r\n", $file)
echo "Downstream: ".$haufen[0]."<br />\r\n";
echo "Upstream: ".$haufen[1]."<br />\r\n";
echo "Uptime: ".$haufen[2]."<br />\r\n";
echo "CPU Usage: ".$haufen[3]."%";
?>
In PHP 4.1.2 the content of jetzt.log was seperated into the array
$haufen and the script printed it fine out. Since PHP 4.2.0 all content
of jetzt.log is written into $haufen[0], including carriage returns and
line feeds. It is the same when I only use "\r" as seperator; when I
use "\n", the content is correctly seperated but at the end of each
line there is stil a carriage return.
I found a comparable problem at http://bugs.php.net/bug.php?id=3428
Best regards
Mark Aslan Kuschel
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16714&edit=1