|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-04 14:10 UTC] jani@php.net
[2007-08-16 09:01 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Mar 13 07:00:02 2026 UTC |
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" "