#23846 [Dup->Csd]: Problem with fputs()
| From: | claudio dot pabst at ch dot abb dot com | Date: | Wed, 28 May 2003 13:10:33 +0000 |
| Subject: | #23846 [Dup->Csd]: Problem with fputs() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40569@lists.php.net to get a copy of this message | ||
ID: 23846
User updated by: claudio dot pabst at ch dot abb dot com
Reported By: claudio dot pabst at ch dot abb dot com
-Status: Duplicate
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: Windows 2000 Server
PHP Version: 4.3.2RC4
New Comment:
i'm using the apache sapi.
thanks,
claudio
Previous Comments:
------------------------------------------------------------------------
[2003-05-28 05:06:10] wez@php.net
fopen("testfile.txt", "wb");
^
Use binary mode
this is a duplicate of another report and is an issue with the Apache
SAPI.
------------------------------------------------------------------------
[2003-05-28 04:48:17] claudio dot pabst at ch dot abb dot com
I have a problem with the fputs() function.
For example:
$newarray[0] = "test123\n";
$newarray[1] = "blablabla\n";
$newarray[2] = "hello\n";
if($myfile = fopen("testfile.txt", "w")) {
foreach($newarray as $line) {
fputs($myfile, $line, strlen($line));
}
fclose($myfile);
... a script like this works with php 4.3.1, but not with 4.3.2RC4.
Instead of a newline, the fputs function writes another ascii char. Its
impossible for me, to read a file into an array after usinf fputs (php
4.3.2RC4).
Perhaps, this problem only exists on windows systems...
Regards,
Claudio
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23846&edit=1