Bug #54134 [Com]: fputcsv $enclosure bug
| From: | carsten_sttgt at gmx dot de | Date: | Fri, 04 Mar 2011 09:40:48 +0000 |
| Subject: | Bug #54134 [Com]: fputcsv $enclosure bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159214@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54134&edit=1
ID: 54134
Comment by: carsten_sttgt at gmx dot de
Reported by: vincent at vincen dot tk
Summary: fputcsv $enclosure bug
Status: Open
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows 7
PHP Version: 5.3SVN-2011-03-02 (snap)
Block user comment: N
Private report: N
New Comment:
> fputcsv($fh, array $line, ";", '"');
>
> this short samples provide us three double quotes (or none)
> around each elements of the array.
$line = 'foobar';
No need to enclose the field, because it doesn't contain reserved
characters
$line = '"foobar"';
a) If the enclose character (") is used in the field, it have to be
doubled ("")
--> ""foobar""
b) Contains a reserved character ("), so it have to be enclosed
--> """foobar"""
See RFC4180.
Previous Comments:
------------------------------------------------------------------------
[2011-03-02 11:18:06] vincent at vincen dot tk
Description:
------------
---
From manual page: http://www.php.net/function.fputcsv
---
fputcsv($fh, array $line, ";", '"');
this short samples provide us three double quotes (or none) around each
elements
of the array.
Expected result:
----------------
i expected one double quotes around each elements.
Actual result:
--------------
this short samples provide us three double quotes (or none) around each
elements
of the array.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54134&edit=1