ID: 42202
Updated by: [EMAIL PROTECTED]
Reported By: nikhil dot gupta at in dot ibm dot com
Status: Open
-Bug Type: Filesystem function related
+Bug Type: Documentation problem
Operating System: Linux, Windows
PHP Version: 5CVS-2007-08-03 (CVS)
New Comment:
This is the correct behaviour. Reclassified as docu bug.
Previous Comments:
------------------------------------------------------------------------
[2007-08-03 12:13:34] nikhil dot gupta at in dot ibm dot com
Description:
------------
fputcsv() inserts a newline character at the end of string. This
behaviour is not seen in the documentation. This happens for both php5
and php6 on windows as well as on RHEL.
Reproduce code:
---------------
<?php
$list = array ('aaa,bbb');
$fp = fopen("file.tmp", 'w');
var_dump(fputcsv($fp, $list));
var_dump( filesize("file.tmp") );
var_dump( file_get_contents("file.tmp") );
fclose($fp);
?>
Expected result:
----------------
int(9)
int(9)
string(9) ""aaa,bbb""
Actual result:
--------------
int(10)
int(10)
string(10) ""aaa,bbb"
"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42202&edit=1